summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore9
-rw-r--r--Makefile4
-rw-r--r--njs.spec104
3 files changed, 117 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..01f0400
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,9 @@
+clog
+package-*.xml
+*.tgz
+*.tar.bz2
+*.tar.gz
+*.tar.xz
+*.tar.xz.asc
+*.src.rpm
+*/*rpm
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..91b0fd5
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,4 @@
+SRCDIR := $(shell pwd)
+NAME := $(shell basename $(SRCDIR))
+include ../../common/Makefile
+
diff --git a/njs.spec b/njs.spec
new file mode 100644
index 0000000..bf8e52c
--- /dev/null
+++ b/njs.spec
@@ -0,0 +1,104 @@
+# remirepo/fedora spec file for njs
+#
+# Copyright (c) 2023 Remi Collet
+# License: CC-BY-SA-4.0
+# http://creativecommons.org/licenses/by-sa/4.0/
+#
+# Please, preserve the changelog entries
+#
+
+%bcond_without tests
+# require ONLINE build for sources download
+%bcond_with wasm
+
+%global gh_owner nginx
+%global project njs
+%global gh_commit 2d52669773eca3188033ac5b400fbe4f5ad7b439
+%global gh_short %(c=%{gh_commit}; echo ${c:0:7})
+
+Name: %{project}
+Summary: NGINX JavaScript
+Version: 0.8.2
+Release: 1%{?dist}
+License: BSD-2-Clause
+URL: https://github.com/%{gh_owner}/%{project}
+
+Source0: https://github.com/%{gh_owner}/%{project}/archive/%{gh_commit}/%{project}-%{version}-%{gh_short}.tar.gz
+
+BuildRequires: make
+BuildRequires: gcc
+BuildRequires: openssl-devel
+BuildRequires: pcre2-devel
+BuildRequires: libedit-devel
+BuildRequires: libxml2-devel
+BuildRequires: zlib-devel
+BuildRequires: expect
+
+
+%description
+NGINX JavaScript (njs).
+
+njs is a subset of the JavaScript language that allows extending nginx
+functionality. njs is created in compliance with ECMAScript 5.1 (strict mode)
+with some ECMAScript 6 and later extensions. The compliance is still evolving.
+
+
+%package -n libnjs-devel
+Summary: libnjs development files
+Requires: %{name}%{?_isa} = %{version}-%{release}
+
+%description -n libnjs-devel
+Library and include files required for libnjs.
+
+
+%prep
+%setup -qn %{project}-%{gh_commit}
+
+
+%build
+./configure
+
+make %{?_smp_mflags}
+make pc
+
+# Fix pkgconfig
+sed -e '/^prefix/s|=.*$|=%{_prefix}|' \
+ -e '/^libdir/s|=.*$|=%{_libdir}|' \
+ -e '/^Cflags/s|:.*$|: -I%{_includedir}/njs|' \
+ build/njs.pc | tee build/njs.pcx
+
+
+%install
+# Library
+install -dm 0755 %{buildroot}%{_includedir}/njs/
+install -pm 0644 */njs*.h %{buildroot}%{_includedir}/njs/
+install -dm 0755 %{buildroot}%{_libdir}/pkgconfig
+install -pm 0755 build/libnjs.a %{buildroot}%{_libdir}
+install -pm 0755 build/njs.pcx %{buildroot}%{_libdir}/pkgconfig/njs.pc
+# Command
+install -dm 0755 %{buildroot}%{_bindir}
+install -pm 0755 build/njs %{buildroot}%{_bindir}
+
+
+%if %{with tests}
+%check
+make test %{?_smp_mflags}
+%endif
+
+
+%files
+%{!?_licensedir:%global license %%doc}
+%license LICENSE
+%{_bindir}/njs
+
+%files -n libnjs-devel
+%license LICENSE
+%doc CHANGES
+%{_libdir}/libnjs.a
+%{_includedir}/njs
+%{_libdir}/pkgconfig/njs.pc
+
+
+%changelog
+* Tue Dec 19 2023 Remi Collet <remi@remirepo.net> - 0.8.2-1
+- initial package