From d5b0f37474da55c7f9da38fca40fb8f6faea33b6 Mon Sep 17 00:00:00 2001 From: Jaroslav Škarvada Date: Apr 04 2017 08:19:58 +0000 Subject: New version Resolves: rhbz#1438614 Dropped pidfile and examples-noshebang patches (both upstreamed) Updated install-fix patch --- diff --git a/.gitignore b/.gitignore index ee32fba..100a99d 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /amprd-1.4.tgz +/amprd-1.5.tgz diff --git a/amprd-1.4-examples-noshebang.patch b/amprd-1.4-examples-noshebang.patch deleted file mode 100644 index 2190c49..0000000 --- a/amprd-1.4-examples-noshebang.patch +++ /dev/null @@ -1,10 +0,0 @@ -diff --git a/startup_example.sh b/startup_example.sh -index fa5b6b0..6ea9171 100755 ---- a/startup_example.sh -+++ b/startup_example.sh -@@ -1,5 +1,3 @@ --#!/bin/bash -- - # - # Example script to start amprd 1.0 - Marius, YO2LOJ, - # diff --git a/amprd-1.4-install-fix.patch b/amprd-1.4-install-fix.patch deleted file mode 100644 index 21d9ff0..0000000 --- a/amprd-1.4-install-fix.patch +++ /dev/null @@ -1,48 +0,0 @@ -diff --git a/Makefile b/Makefile -index 06688e9..b56e067 100644 ---- a/Makefile -+++ b/Makefile -@@ -2,26 +2,22 @@ - # Makefile for ampr-ripd - # - --CONFDIR = /etc --SBINDIR = /usr/sbin --SCACHEDIR = /var/lib/amprd -- --# no need to run dx-broadcast as root --OWN = daemon --GRP = daemon -+CONFDIR = $(DESTDIR)/etc -+SBINDIR = $(DESTDIR)/usr/sbin -+SCACHEDIR = $(DESTDIR)/var/lib/amprd - - CC = gcc --COPT = -Wall -O2 -+CFLAGS = -Wall -O2 - LD = gcc --LOPT = -+LDFLAGS = - - OBJFILES = amprd.o tunnel.o minIni.o list.o rip.o encap.o cache.o route.o - - .c.o: -- $(CC) $(COPT) -c $< -+ $(CC) $(CFLAGS) -c $< - - amprd: $(OBJFILES) -- $(LD) $(LOPT) -o amprd $(OBJFILES) -+ $(LD) $(LDFLAGS) -o amprd $(OBJFILES) - - all: amprd - -@@ -30,6 +26,6 @@ clean: - - install: amprd - # strip amprd -- install -m 755 -o $(OWN) -g $(GRP) -d $(SCACHEDIR) -- install -m 644 -o $(OWN) -g $(GRP) amprd.conf.example $(CONFDIR) -- install -m 755 -o $(OWN) -g $(GRP) amprd $(SBINDIR) -+ install -m 755 -p -d -D $(SCACHEDIR) -+ install -m 644 -p -D amprd.conf.example $(CONFDIR)/amprd.conf -+ install -m 755 -p -D amprd $(SBINDIR)/amprd diff --git a/amprd-1.4-pidfile.patch b/amprd-1.4-pidfile.patch deleted file mode 100644 index 4439f33..0000000 --- a/amprd-1.4-pidfile.patch +++ /dev/null @@ -1,66 +0,0 @@ -diff --git a/amprd.c b/amprd.c -index 4eee8d2..5a3eb99 100644 ---- a/amprd.c -+++ b/amprd.c -@@ -68,6 +68,7 @@ - #include "commons.h" - - #define MAXPAYLOAD (2048) -+#define PIDFILE "/var/run/amprd.pid" - - char *passwd = NULL; - int debug = FALSE; -@@ -83,6 +84,7 @@ uint32_t general_ampr_gw; - - uint32_t myips[MYIPSIZE]; - -+void (*sigterm_defhnd)(int); - - void on_alarm(int sig) - { -@@ -146,6 +148,16 @@ void on_hup(int sig) - verbose = FALSE; - } - -+void on_term(int sig) -+{ -+ signal(SIGTERM, SIG_IGN); -+ -+ unlink(PIDFILE); -+ -+ signal(SIGTERM, sigterm_defhnd); -+ raise(SIGTERM); -+} -+ - uint32_t getip(const char *dev) - { - struct ifreq ifr; -@@ -260,6 +272,7 @@ int main(int argc, char**argv) - struct pollfd *pollfd; - int i, j, payload, best, mask, bmask; - Tunnel *tunnel; -+ FILE *pidfile; - - char *ip = malloc(MAXPAYLOAD + 18); /* eth header + tcp/ip frame + checksum */ - char *rcv = malloc(MAXPAYLOAD + 20); /* ip header + tcp/ip frame */ -@@ -343,7 +356,6 @@ int main(int argc, char**argv) - sa.sa_handler = on_hup; - sigaction(SIGHUP, &sa, 0); - -- - if (FALSE == debug) - { - pid_t fork_res = -1; -@@ -361,6 +373,12 @@ int main(int argc, char**argv) - } - } - -+ sa.sa_handler = on_term; -+ sigaction(SIGTERM, &sa, 0); -+ pidfile = fopen(PIDFILE, "w"); -+ fprintf(pidfile, "%d\n", (int)getpid()); -+ fclose(pidfile); -+ - pollfd = malloc(sizeof(struct pollfd) * (numtunnels + 1)); - - pollfd[0].fd = raw_socket; diff --git a/amprd-1.5-install-fix.patch b/amprd-1.5-install-fix.patch new file mode 100644 index 0000000..708afef --- /dev/null +++ b/amprd-1.5-install-fix.patch @@ -0,0 +1,12 @@ +diff --git a/Makefile b/Makefile +index 818a77a..23d12bc 100644 +--- a/Makefile ++++ b/Makefile +@@ -26,5 +26,5 @@ clean: + + install: amprd + install -m 755 -p -d -D $(SCACHEDIR) +- install -m 644 -p -b -D amprd.conf.example $(CONFDIR)/amprd.conf +- install -m 755 -p -s -D amprd $(SBINDIR)/amprd ++ install -m 644 -p -D amprd.conf.example $(CONFDIR)/amprd.conf ++ install -m 755 -p -D amprd $(SBINDIR)/amprd diff --git a/amprd.spec b/amprd.spec index 29e65fd..7429c3f 100644 --- a/amprd.spec +++ b/amprd.spec @@ -8,8 +8,8 @@ Summary: An user-space IPIP encapsulation daemon for the ampr network Name: amprd -Version: 1.4 -Release: 5%{?dist} +Version: 1.5 +Release: 1%{?dist} License: GPLv3+ Group: Applications/Communications URL: http://www.yo2loj.ro/hamprojects/ @@ -19,9 +19,7 @@ Requires(preun): systemd Requires(postun): systemd Source0: http://www.yo2loj.ro/hamprojects/%{name}-%{version}.tgz Source1: amprd.service -Patch0: amprd-1.4-install-fix.patch -Patch1: amprd-1.4-pidfile.patch -Patch2: amprd-1.4-examples-noshebang.patch +Patch0: amprd-1.5-install-fix.patch %description An user-space IPIP encapsulation daemon with automatic RIPv2 multicast @@ -33,8 +31,6 @@ the system for your 44net traffic. %prep %setup -qc %patch0 -p1 -b .install-fix -%patch1 -p1 -b .pidfile -%patch2 -p1 -b .examples-noshebang dos2unix minGlue.h @@ -70,6 +66,12 @@ install -Dpm 644 -t %{buildroot}%{_datadir}/%{name} startup_example.sh interface %{_unitdir}/amprd.service %changelog +* Tue Apr 4 2017 Jaroslav Škarvada - 1.5-1 +- New version + Resolves: rhbz#1438614 +- Dropped pidfile and examples-noshebang patches (both upstreamed) +- Updated install-fix patch + * Fri Feb 10 2017 Fedora Release Engineering - 1.4-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild diff --git a/sources b/sources index 31f6356..c0cfee3 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -2cba21d7866c94a30c85daf7468998ae amprd-1.4.tgz +SHA512 (amprd-1.5.tgz) = 6d722e49bd4a829df6bac5c7fb26df1a156e6f6d189f52ea58d5589972966fd372fbaad35984ffc1bdd95e129c2773ac717719815b80eaab51ba1a8a925900d8