diff --git a/.gear/pages-server.service b/.gear/pages-server.service new file mode 100644 index 0000000..225978a --- /dev/null +++ b/.gear/pages-server.service @@ -0,0 +1,17 @@ +[Unit] +Description=The Codeberg Pages Server with custom domain support +After=network.target +After=network-online.target +Wants=network-online.target + +[Service] +Type=simple +PIDFile=/run/pages-server/pages-server.pid +ExecStart=/usr/bin/pages-server --config-file /etc/pages-server/config.toml +Restart=on-failure + +User=pages +Group=pages + +[Install] +WantedBy=multi-user.target diff --git a/.gear/pages-server.spec b/.gear/pages-server.spec new file mode 100644 index 0000000..b7c5305 --- /dev/null +++ b/.gear/pages-server.spec @@ -0,0 +1,80 @@ +%define _unpackaged_files_terminate_build 1 +%global import_path codeberg.org/Codeberg/pages-server +%define server_user pages + +Name: pages-server +Version: 6.1 +Release: alt1 + +Summary: The Codeberg Pages Server with custom domain support + +License: EUPL-1.2 +Group: Other +Url: https://codeberg.page +Vcs: https://codeberg.org/Codeberg/pages-server.git + +Source0: %name-%version.tar +Source1: %name.service +Source2: example_config.toml + +Patch: %name-%version-%release.patch + +ExclusiveArch: %go_arches + +BuildRequires(pre): rpm-macros-golang +BuildRequires: rpm-build-golang golang >= 1.22 + +%description +Codeberg Pages allows you to easily publish static websites with a +human-friendly address ({username}.codeberg.page) via Git on Codeberg. + +%prep +%setup +%patch -p1 + +%build +export BUILDDIR="$PWD/.build" +export IMPORT_PATH="%import_path" +export GOPATH="$BUILDDIR:%go_path" + +%golang_prepare +pushd $BUILDDIR/src/%import_path +%gobuild -o %name . +popd + +%install +export BUILDDIR="$PWD/.build" +export IGNORE_SOURCES=1 +export IMPORT_PATH="%import_path" +%golang_install + +mkdir -p %buildroot%_sysconfdir/%name +mkdir -p %buildroot%_localstatedir/%name + +install -Dm644 %SOURCE1 %buildroot%_unitdir/%name.service +install -m644 %SOURCE2 %buildroot%_sysconfdir/%name/config.toml + +mkdir -p %buildroot%_bindir/ +cd .build/src/%import_path +install -p -m755 %name %buildroot%_bindir/%name + +%post +%post_systemd_postponed %name.service + +%preun +%preun_systemd %name.service + +%pre +groupadd -r -f %server_user +useradd -r -g %server_user -M -d %_localstatedir/%name -s /dev/null -c "pages" %server_user +usermod -a -G tape %server_user + +%files +%_bindir/%name +%config(noreplace) %_sysconfdir/%name/config.toml +%_unitdir/%name.service +%doc *.md LICENSE + +%changelog +* Wed Nov 27 2024 Konstantin Kozoriz 6.1-alt1 +- Initial build. diff --git a/.gear/rules b/.gear/rules new file mode 100644 index 0000000..1b865a9 --- /dev/null +++ b/.gear/rules @@ -0,0 +1,6 @@ +tar: v@version@:. +diff: v@version@:. . +spec: .gear/pages-server.spec + +copy: .gear/*.service +copy: example_config.toml diff --git a/.gear/tags/cb0911f0c9242dac91b5350960e58c0bbc32a9a7 b/.gear/tags/cb0911f0c9242dac91b5350960e58c0bbc32a9a7 new file mode 100644 index 0000000..87d84f9 --- /dev/null +++ b/.gear/tags/cb0911f0c9242dac91b5350960e58c0bbc32a9a7 @@ -0,0 +1,15 @@ +object 85059aa46ef0b04c76646c8a56a7860f5007f58a +type commit +tag v6.1 +tagger crapStone 1732232136 +0100 + +v6.1 + +Improved caching of pages. +-----BEGIN PGP SIGNATURE----- + +iIcEABYKAC8WIQQQHBKbauF/62FpPBsi1L8M98wpyAUCZz/D2BEcbWVAY3JhcHN0 +b25lLmRldgAKCRAi1L8M98wpyA2OAP9qpnXNoO0CE72X3mpR7wpRXr8n3EL/K4Xi +rC9fbTq91AEA2+RAeX/t07EdlmvoLjg8AI4/e2eYoPNLAN4z83XfzwI= +=xZxd +-----END PGP SIGNATURE----- diff --git a/.gear/tags/list b/.gear/tags/list new file mode 100644 index 0000000..a1d1078 --- /dev/null +++ b/.gear/tags/list @@ -0,0 +1 @@ +cb0911f0c9242dac91b5350960e58c0bbc32a9a7 v6.1