-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathpxesrv.spec
52 lines (38 loc) · 1.28 KB
/
pxesrv.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
%global provider github
%global provider_tld com
%global project DongJeremy
%global repo pxesrv
# https://github.com/DongJeremy/pxesrv
%global provider_prefix %{provider}.%{provider_tld}/%{project}/%{repo}
%global import_path %{provider_prefix}
Name: pxesrv
Version: 1.0.0
Release: 1%{?dist}
Summary: gonews Daily News Retrieval Platform
Group: Development/Tools
License: MIT
URL: https://%{provider_prefix}
Source0: https://%{provider_prefix}/archive/v%{version}.tar.gz
BuildRequires: golang, upx
Requires: redis, git
%description
Gonews for Daily News Retrieval Platform
%prep
%setup -q
%build
go build -ldflags "-s -w" -o pxesrv main.go
upx --brute pxesrv
%install
install -d -p %{buildroot}/usr/local/pxeserver/
install -p -m 0755 pxesrv %{buildroot}/usr/local/pxeserver/%{name}
install -p -m 0644 pxe.yml %{buildroot}/usr/local/pxeserver/
cp -a {netboot,templates} %{buildroot}/usr/local/pxeserver/
mkdir -p $RPM_BUILD_ROOT%{_unitdir}
install -m 0644 %{name}.service $RPM_BUILD_ROOT%{_unitdir}
# delete all .gitkeep files.
find %{buildroot}/usr/local/pxeserver/ -name .gitkeep -exec rm -fr {} \;
%files
%defattr(-,root,root)
/usr/local/pxeserver
%{_unitdir}/%{name}.service
%changelog