Move RPM build files to main repository
This commit is contained in:
parent
bae68520a2
commit
578cd8b24b
6 changed files with 120 additions and 3 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,2 +1,3 @@
|
|||
miniflux-*
|
||||
miniflux
|
||||
*.rpm
|
13
Makefile
13
Makefile
|
@ -35,7 +35,7 @@ export PGPASSWORD := postgres
|
|||
clean-integration-test \
|
||||
docker-image \
|
||||
docker-images \
|
||||
docker-manifest
|
||||
rpm
|
||||
|
||||
generate:
|
||||
@ go generate
|
||||
|
@ -95,7 +95,7 @@ run: generate
|
|||
@ LOG_DATE_TIME=1 go run main.go -debug
|
||||
|
||||
clean:
|
||||
@ rm -f $(APP)-* $(APP)
|
||||
@ rm -f $(APP)-* $(APP) $(APP)*.rpm
|
||||
|
||||
test:
|
||||
go test -cover -race -count=1 ./...
|
||||
|
@ -128,3 +128,12 @@ docker-images:
|
|||
--file packaging/docker/Dockerfile \
|
||||
--tag $(DOCKER_IMAGE):$(VERSION) \
|
||||
--push .
|
||||
|
||||
rpm: clean
|
||||
@ docker build \
|
||||
-t miniflux-rpm-builder \
|
||||
-f packaging/rpm/Dockerfile \
|
||||
.
|
||||
@ docker run --rm \
|
||||
-v ${PWD}:/root/rpmbuild/RPMS/x86_64/ miniflux-rpm-builder \
|
||||
rpmbuild -bb --define "_miniflux_version $(VERSION)" /root/rpmbuild/SPECS/miniflux.spec
|
||||
|
|
3
packaging/miniflux.conf
Normal file
3
packaging/miniflux.conf
Normal file
|
@ -0,0 +1,3 @@
|
|||
# See https://miniflux.app/docs/configuration.html
|
||||
|
||||
RUN_MIGRATIONS=1
|
20
packaging/rpm/Dockerfile
Normal file
20
packaging/rpm/Dockerfile
Normal file
|
@ -0,0 +1,20 @@
|
|||
FROM golang:1 AS build
|
||||
ADD . /go/src/app
|
||||
WORKDIR /go/src/app
|
||||
RUN go generate
|
||||
RUN go build \
|
||||
-o miniflux \
|
||||
-ldflags="-s -w -X 'miniflux.app/version.Version=`git describe --abbrev=0`' -X 'miniflux.app/version.Commit=`git rev-parse --short HEAD`' -X 'miniflux.app/version.BuildDate=`date +%FT%T%z`'" \
|
||||
main.go
|
||||
|
||||
FROM centos:latest
|
||||
RUN dnf install -y rpm-build
|
||||
RUN mkdir -p /root/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
|
||||
RUN echo "%_topdir /root/rpmbuild" >> .rpmmacros
|
||||
COPY --from=build /go/src/app/miniflux /root/rpmbuild/SOURCES/miniflux
|
||||
COPY --from=build /go/src/app/LICENSE /root/rpmbuild/SOURCES/
|
||||
COPY --from=build /go/src/app/ChangeLog /root/rpmbuild/SOURCES/
|
||||
COPY --from=build /go/src/app/miniflux.1 /root/rpmbuild/SOURCES/
|
||||
COPY --from=build /go/src/app/packaging/systemd/miniflux.service /root/rpmbuild/SOURCES/
|
||||
COPY --from=build /go/src/app/packaging/miniflux.conf /root/rpmbuild/SOURCES/
|
||||
COPY --from=build /go/src/app/packaging/rpm/miniflux.spec /root/rpmbuild/SPECS/miniflux.spec
|
61
packaging/rpm/miniflux.spec
Normal file
61
packaging/rpm/miniflux.spec
Normal file
|
@ -0,0 +1,61 @@
|
|||
%undefine _disable_source_fetch
|
||||
|
||||
Name: miniflux
|
||||
Version: %{_miniflux_version}
|
||||
Release: 1.0
|
||||
Summary: Minimalist and opinionated feed reader
|
||||
URL: https://miniflux.app/
|
||||
License: ASL 2.0
|
||||
Source0: miniflux
|
||||
Source1: miniflux.service
|
||||
Source2: miniflux.conf
|
||||
Source3: miniflux.1
|
||||
Source4: LICENSE
|
||||
Source5: ChangeLog
|
||||
BuildRoot: %{_topdir}/BUILD/%{name}-%{version}-%{release}
|
||||
BuildArch: x86_64
|
||||
Requires(pre): shadow-utils
|
||||
|
||||
%{?systemd_requires}
|
||||
BuildRequires: systemd
|
||||
|
||||
%description
|
||||
%{summary}
|
||||
|
||||
%install
|
||||
mkdir -p %{buildroot}%{_bindir}
|
||||
install -p -m 755 %{SOURCE0} %{buildroot}%{_bindir}/miniflux
|
||||
install -D -m 644 %{SOURCE1} %{buildroot}%{_unitdir}/miniflux.service
|
||||
install -D -m 600 %{SOURCE2} %{buildroot}%{_sysconfdir}/miniflux.conf
|
||||
install -D -m 644 %{SOURCE3} %{buildroot}%{_mandir}/man1/miniflux.1
|
||||
install -D -m 644 %{SOURCE4} %{buildroot}%{_docdir}/miniflux/LICENSE
|
||||
install -D -m 644 %{SOURCE5} %{buildroot}%{_docdir}/miniflux/ChangeLog
|
||||
|
||||
%files
|
||||
%defattr(755,root,root)
|
||||
%{_bindir}/miniflux
|
||||
%{_docdir}/miniflux
|
||||
%defattr(644,root,root)
|
||||
%{_unitdir}/miniflux.service
|
||||
%{_mandir}/man1/miniflux.1*
|
||||
%{_docdir}/miniflux/*
|
||||
%defattr(600,root,root)
|
||||
%config(noreplace) %{_sysconfdir}/miniflux.conf
|
||||
|
||||
%pre
|
||||
getent group miniflux >/dev/null || groupadd -r miniflux
|
||||
getent passwd miniflux >/dev/null || \
|
||||
useradd -r -g miniflux -d /dev/null -s /sbin/nologin \
|
||||
-c "Miniflux Daemon" miniflux
|
||||
exit 0
|
||||
|
||||
%post
|
||||
%systemd_post miniflux.service
|
||||
|
||||
%preun
|
||||
%systemd_preun miniflux.service
|
||||
|
||||
%postun
|
||||
%systemd_postun_with_restart miniflux.service
|
||||
|
||||
%changelog
|
23
packaging/systemd/miniflux.service
Normal file
23
packaging/systemd/miniflux.service
Normal file
|
@ -0,0 +1,23 @@
|
|||
[Unit]
|
||||
Description=Miniflux Feed Reader
|
||||
After=network.target postgresql.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
EnvironmentFile=/etc/miniflux.conf
|
||||
User=miniflux
|
||||
ExecStart=/usr/bin/miniflux
|
||||
Restart=always
|
||||
|
||||
# Hardening options:
|
||||
NoNewPrivileges=true
|
||||
PrivateDevices=true
|
||||
ProtectControlGroups=true
|
||||
ProtectHome=true
|
||||
ProtectKernelModules=true
|
||||
ProtectKernelTunables=true
|
||||
ProtectSystem=strict
|
||||
RestrictRealtime=true
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
Loading…
Reference in a new issue