blob: cc3356364816a7e08cdefe8afdca7d3573f87182 [file] [log] [blame]
Tomas Cejka834004f2014-04-27 20:13:39 +02001Summary: Netopeer-GUI (backend)
Tomas Cejka96f4e612012-12-10 00:03:32 +01002Name: mod_netconf
Tomas Cejka834004f2014-04-27 20:13:39 +02003Version: @VERSION@
Tomas Cejka96f4e612012-12-10 00:03:32 +01004Release: @RELEASE@
Tomas Cejka834004f2014-04-27 20:13:39 +02005URL: https://github.com/CESNET/mod_netconf
6Source: %{name}-%{version}-%{release}.tar.gz
Tomas Cejka96f4e612012-12-10 00:03:32 +01007Group: Liberouter
8License: BSD
9Vendor: CESNET, z.s.p.o.
10Packager: @USERNAME@ <@USERMAIL@>
11BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}
12
Tomas Cejka834004f2014-04-27 20:13:39 +020013BuildRequires: apr apr-util libxml2-devel json-c-devel libwebsockets-devel libnetconf-devel
14Requires: json-c libwebsockets libnetconf httpd libxml2
Tomas Cejka96f4e612012-12-10 00:03:32 +010015
16%description
Tomas Cejka834004f2014-04-27 20:13:39 +020017Backend for Netopeer-GUI, available at https://github.com/CESNET/Netopeer-GUI
Tomas Cejka96f4e612012-12-10 00:03:32 +010018
19%prep
20%setup
21
22%build
Tomas Cejka834004f2014-04-27 20:13:39 +020023%configure --prefix="$RPM_BUILD_ROOT" httpdmoduledir="/usr/lib64/httpd/modules" httpdconfddir="/etc/httpd/conf.d"
Tomas Cejka96f4e612012-12-10 00:03:32 +010024make
25
26%install
Tomas Cejka5ab8ff22014-07-23 01:30:19 +020027#make DESTDIR=$RPM_BUILD_ROOT RUN="RPM" install
Tomas Cejka834004f2014-04-27 20:13:39 +020028make install
Tomas Cejka96f4e612012-12-10 00:03:32 +010029
30%post
31#add device module to configuration only when installing, not on update or reinstall.
32#https://fedoraproject.org/wiki/Packaging:Guidelines?rd=Packaging/Guidelines#Running_scriptlets_only_in_certain_situations
Tomas Cejkaba21b382013-04-13 02:37:32 +020033[ -d /var/run/httpd ] || { mkdir -p /var/run/httpd && chown apache:apache /var/run/httpd; }
Tomas Cejka438142c2013-11-17 23:57:30 +010034chcon system_u:object_r:httpd_modules_t:s0 /etc/httpd/modules/mod_netconf.so
Tomas Cejka96f4e612012-12-10 00:03:32 +010035service httpd restart
36
37%postun
38#delete device module from configuration only when erasing, not on update.
39#https://fedoraproject.org/wiki/Packaging:Guidelines?rd=Packaging/Guidelines#Running_scriptlets_only_in_certain_situations
40service httpd restart
41rm -f /tmp/mod_netconf.sock
42
43%files
44%doc README
45%{_libdir}/httpd/modules/*.so
46%config(noreplace) %{_sysconfdir}/httpd/conf.d/*.conf
47