File: aprx.spec.in

package info (click to toggle)
aprx 2.9.0+dfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 2,352 kB
  • sloc: ansic: 15,809; sh: 598; makefile: 160
file content (118 lines) | stat: -rw-r--r-- 3,080 bytes parent folder | download | duplicates (2)
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
Name:           aprx
Version:        @VERSION@
Release:        1%{?dist}
Summary:        Hamradio APRS iGate / Digipeater
License:        BSD
URL:            http://ham.zmailer.org/oh2mqk/aprx/
Source0:        http://ham.zmailer.org/oh2mqk/aprx/%{name}-%{version}.tar.gz


%if 0%{?rhel} >= 7 || 0%{?fedora} >= 16
BuildRequires:  systemd-units
%endif

%if 0%{?fedora} >= 18
Requires(post): systemd
Requires(preun): systemd
Requires(postun): systemd

%post
%systemd_post %{name}.service

%preun
%systemd_preun %{name}.service

%postun
%systemd_postun_with_restart %{name}.service 

%else 0%{?fedora} = 17
Requires(post): systemd-units
Requires(preun): systemd-units
Requires(postun): systemd-units

%post
if [ $1 -eq 1 ] ; then 
    # Initial installation 
    /bin/systemctl daemon-reload >/dev/null 2>&1 || :
fi

%preun
if [ $1 -eq 0 ] ; then
    # Package removal, not upgrade
    /bin/systemctl --no-reload disable aprx.service > /dev/null 2>&1 || :
    /bin/systemctl stop aprx.service > /dev/null 2>&1 || :
fi

%postun
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
if [ $1 -ge 1 ] ; then
    # Package upgrade, not uninstall
    /bin/systemctl try-restart aprx.service >/dev/null 2>&1 || :
fi

%endif

%description
Aprx is an APRS iGate that has minimal system requirements. It can handle
an arbitrary number of radio modems, optionally relay APRS packets from radio
to the APRS-IS network, optionally digipeat AX25 with or without NEWn-N
rules, optionally relay APRS packets from APRS-IS to radio (TX-iGate)

%prep
%setup -q

%build
%configure --with-erlangstorage CFLAGS="-m32 -march=i386" LDFLAGS="-m32 -march=i386"
make %{?_smp_mflags}
make logrotate.aprx

%install
mkdir -p $RPM_BUILD_ROOT/etc/sysconfig
mkdir -p $RPM_BUILD_ROOT/etc/logrotate.d
mkdir -p $RPM_BUILD_ROOT/var/log/aprx

make install DESTDIR=$RPM_BUILD_ROOT

install -m 644 logrotate.aprx   $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/aprx
install -m 644 rpm/aprx.default $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/aprx

%if 0%{?rhel} >= 7 || 0%{?fedora} >= 16
mkdir -p $RPM_BUILD_ROOT%{_unitdir}
install -m 644 rpm/aprx.service $RPM_BUILD_ROOT%{_unitdir}/%{name}.service
%else
mkdir -p $RPM_BUILD_ROOT%{_initddir}
install -m 755 rpm/aprx.init    $RPM_BUILD_ROOT%{_initddir}/aprx
%endif

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root,-)
# INSTALL not bundled
%doc LICENSE README TODO PROTOCOLS
%doc ChangeLog
%doc aprx.conf aprx-complex.conf
%doc doc/aprx-manual.pdf
%doc ViscousDigipeater.README ViscousDigipeaterTxEffect.png
%dir /var/log/aprx
%if 0%{?rhel} >= 7 || 0%{?fedora} >= 16
%{_unitdir}/%{name}.service
%else
%{_initddir}/%{name}
%endif
%config(noreplace) %{_sysconfdir}/aprx.conf
%config(noreplace) %{_sysconfdir}/sysconfig/aprx
%config(noreplace) %{_sysconfdir}/logrotate.d/aprx
%{_sbindir}/aprx
%{_sbindir}/aprx-stat
%doc %{_mandir}/man8/aprx.8.gz
%doc %{_mandir}/man8/aprx-stat.8.gz


%changelog
* Thu Oct 11 2012 Andrew Elwell <Andrew.Elwell@gmail.com> - @VERSION@
- Packaging for Fedora

* Sat Jan 12 2008 Matti Aarnio - OH2MQK - KP20NG <oh2mqk@sral.fi> - 
- RPM framework added