From 49190f666bac682a9dbc2ffd27c2220a48f2476e Mon Sep 17 00:00:00 2001 From: webbuilder_pel7ppc64lebuilder0 Date: Mon, 7 Jun 2021 11:18:23 +0200 Subject: [PATCH] authelia package createion Signed-off-by: webbuilder_pel7ppc64lebuilder0 --- SPECS/authelia.spec | 72 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 SPECS/authelia.spec diff --git a/SPECS/authelia.spec b/SPECS/authelia.spec new file mode 100644 index 0000000..b42f210 --- /dev/null +++ b/SPECS/authelia.spec @@ -0,0 +1,72 @@ +%global _hardened_build 1 +%define debug_package %{nil} + +Name : authelia +Version : 4.29.4 +Release : 1%{dist} +License : MIT +URL : https://www.authelia.com/ +Summary : Single Sign-On Multi-Factor portal for web apps +BuildRequires: golang +BuildRequires: git +BuildRequires: npm + + +%description +Protect your applications with Single Sign-On and 2 Factor. +Authelia is an open-source full-featured authentication server. + + +%prep +%setup -T -q -c %{name}-%{version} +export GOPATH=`pwd` +mkdir -p go/src/github.com/authelia/ +cd go/src/github.com/authelia/ +git clone https://github.com/authelia/authelia + + +%build +export GOPATH=`pwd` +export GO111MODULE=on +pushd go/src/github.com/authelia/authelia/ +git checkout v%{version} +pushd web +npm install +npm run build +popd +rm -rf internal/server/public_html +cp -rv web/build internal/server/public_html +cp -rv api internal/server/public_html/api +sed "s/__BUILD_TAG__/"%{version}"/" -i cmd/authelia/constants.go +sed "s/__BUILD_COMMIT__/"%{release}"/" -i cmd/authelia/constants.go +go build -v -tags netgo -trimpath -ldflags "-extldflags -s -w -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \n') -buildid "%{version} -o authelia ./cmd/authelia/ + + +%install +install -p -D -m 0644 go/src/github.com/authelia/authelia/authelia.service %{buildroot}%{_unitdir}/authelia.service +mkdir -p %{buildroot}/%{_sysconfdir}/%{name}/ +install -p -D -m 0644 go/src/github.com/authelia/authelia/config.template.yml %{buildroot}%{_sysconfdir}/%{name}/configuration.yml +mkdir -p %{buildroot}%{_bindir}/ +install -p -D -m 0555 go/src/github.com/authelia/authelia/authelia %{buildroot}%{_bindir}/authelia + + + +%post +%systemd_post authelia.service + + +%preun +%systemd_preun authelia.service + + +%postun +%systemd_postun authelia.service + + +%files +%config(noreplace) %{_sysconfdir}/%{name}/configuration.yml +%{_bindir}/authelia +%{_unitdir}/authelia.service + + +%changelog