From 616d5e4f99aeab54753f6c97224f99abcab1a397 Mon Sep 17 00:00:00 2001 From: webbuilder_pel7ppc64lebuilder0 Date: Mon, 7 Jun 2021 11:20:43 +0200 Subject: [PATCH] remark42 package creation Signed-off-by: webbuilder_pel7ppc64lebuilder0 --- SPECS/remark42.spec | 65 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 SPECS/remark42.spec diff --git a/SPECS/remark42.spec b/SPECS/remark42.spec new file mode 100644 index 0000000..33372f4 --- /dev/null +++ b/SPECS/remark42.spec @@ -0,0 +1,65 @@ +%define debug_package %{nil} + +Name : remark42 +Version : 1.8.1 +Release : 1%{?dist} +Summary : comment engine +Group : System/Web +License : MIT +URL : https://remark42.com/ +#Source0 : +BuildRequires : golang +BuildRequires : git +Requires : git + + +%description + + +%prep +%setup -T -q -c %{name}-%{version} +mkdir go +export GOPATH=`pwd`/go +export GO111MODULE=on +mkdir -p go/src/github.com/imputun/ +cd go/src/github.com/imputun/ +git clone https://github.com/umputun/remark42 +cd remark42 +git checkout tags/v%{version} + + +%build +export GOPATH=`pwd`/go +export GO111MODULE=on +cd go/src/github.com/imputun/remark42 +git checkout tags/v%{version} +### backend - golang +pushd backend +%ifarch ppc64 +export CGO_ENABLED=1 +%endif +go build -v -trimpath -ldflags "-extldflags -s -w -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \n') -buildid "%{version}" -X main.revision="%{version}" -s -w" -o remark42 ./app +popd +### frontend - npm +pushd frontend +npm install +npm run build +popd + + +%install +mkdir -p %{buildroot}/var/lib/remark42/ +install -p -D -m 0555 go/src/github.com/imputun/remark42/backend/remark42 %{buildroot}/var/lib/remark42/remark42 +cp -rv go/src/github.com/imputun/remark42/backend/templates/ %{buildroot}/var/lib/remark42/ +cp -rv go/src/github.com/imputun/remark42/frontend/public/ %{buildroot}/var/lib/remark42/web/ + + + +%files +%doc +/var/lib/remark42/remark42 +/var/lib/remark42/templates/ +/var/lib/remark42/web/ + + +%changelog