[arch-commits] Commit in procstatd/trunk (3 files)
Sergej Pupykin
spupykin at archlinux.org
Mon May 17 20:38:44 UTC 2021
Date: Monday, May 17, 2021 @ 20:38:44
Author: spupykin
Revision: 936104
fix ftbfs
Added:
procstatd/trunk/procstatd-Makefile.patch
procstatd/trunk/procstatd-common-symbols.patch
Modified:
procstatd/trunk/PKGBUILD
--------------------------------+
PKGBUILD | 20 ++-
procstatd-Makefile.patch | 74 +++++++++++++
procstatd-common-symbols.patch | 208 +++++++++++++++++++++++++++++++++++++++
3 files changed, 295 insertions(+), 7 deletions(-)
Modified: PKGBUILD
===================================================================
--- PKGBUILD 2021-05-17 20:05:00 UTC (rev 936103)
+++ PKGBUILD 2021-05-17 20:38:44 UTC (rev 936104)
@@ -9,19 +9,25 @@
arch=('x86_64')
license=('GPL')
url="http://www.phy.duke.edu/brahma/"
-source=(https://downloads.sourceforge.net/herdtools/$pkgname.tar.gz)
-sha512sums=('02f10a87f9325f0252786a598433596ad1dc2c6412ff8b6fe1f8e19a6e1425497bc0fcf0be085ed7be9434642c7a1f22d4f8018787ab2f6dffe0d1aa566dfcc5')
+source=(https://downloads.sourceforge.net/herdtools/$pkgname.tar.gz
+ procstatd-Makefile.patch
+ procstatd-common-symbols.patch)
+sha512sums=('02f10a87f9325f0252786a598433596ad1dc2c6412ff8b6fe1f8e19a6e1425497bc0fcf0be085ed7be9434642c7a1f22d4f8018787ab2f6dffe0d1aa566dfcc5'
+ '96b8cf197c4589cd602af4cb2860c6f33668789c54991e31060b69fe42aa66c11d86472d7bf2066281b324178752b9f88fc3c8a2787c459a6364b052d597e6a4'
+ 'b16266faa53d2e3d012dda8d94c42a49100759299b760cd75d7577f127ea576b6c85ea0f8b72a0cda49e6c2250a37f80ad7d775ab7716877d351f6a947a47da6')
+prepare() {
+ cd "$srcdir"/$pkgname
+ patch -p1 -i ../procstatd-Makefile.patch
+ patch -p1 -i ../procstatd-common-symbols.patch
+}
+
build() {
cd "$srcdir"/$pkgname
- # Get rid of the funky make install forever bug
- sed -i 's/make install/echo/;s/cd watchman/echo/;s@$(INSTDIR)/sbin@$(INSTDIR)/bin@' Makefile
make
}
package() {
cd "$srcdir"/$pkgname
- make INSTDIR="$pkgdir"/usr install
- mkdir "$pkgdir"/usr/share
- mv "$pkgdir"/usr/man "$pkgdir"/usr/share/man
+ make DESTDIR="$pkgdir/usr" install
}
Added: procstatd-Makefile.patch
===================================================================
--- procstatd-Makefile.patch (rev 0)
+++ procstatd-Makefile.patch 2021-05-17 20:38:44 UTC (rev 936104)
@@ -0,0 +1,74 @@
+diff --git a/Makefile b/Makefile
+index c2a2599..bed7042 100644
+--- a/Makefile
++++ b/Makefile
+@@ -23,9 +23,7 @@
+ # General definitions
+ ##########################
+ CC=gcc
+-CFLAGS=-O3
+-COMPILE=$(CC) -c $(CFLAGS)
+-LINK=$(CC)
++CFLAGS?=-O3
+
+ ##########################
+ # Tree point to install
+@@ -33,7 +31,7 @@ LINK=$(CC)
+ ##########################
+ # INSTDIR=/usr/local
+ # INSTDIR=/usr
+-INSTDIR=$(HOME)
++DESTDIR=
+
+ ##########################
+ # Program name(s)
+@@ -41,7 +39,7 @@ INSTDIR=$(HOME)
+ PROGRAM=procstatd
+ WATCHMAN=watchman
+
+-
++all : $(PROGRAM)
+ ##########################
+ # Source and object list
+ ##########################
+@@ -51,20 +49,19 @@ SRC=procstatd.c parsecl.c parse.c statlist.c senddata.c procutils.c \
+ time.c users.c identity.c \
+ ipcstuff.c filestuff.c jobslist.c quiklist.c
+ OBJ=$(SRC:.c=.o)
+-
+ ##########################
+ # Rule to make program
+ ##########################
+ $(PROGRAM) : $(OBJ)
+- $(LINK) $(OBJ) -o $@
++ $(CC) $(LDFLAGS) -o $@ $(OBJ) $(LIBS)
+
+ ##########################
+ # Rule to make .o objects
+ # Note sole .h dependency
+ ##########################
+-%.o : %.c procstatd.h
+- $(COMPILE) $< -o $@
+-
++#%.o : %.c procstatd.h
++# $(COMPILE) $< -o $@
++$(SRC) : procstatd.h
+ ##########################
+ # Rule to clean up
+ ##########################
+@@ -75,11 +72,8 @@ clean :
+ # Rule to install.
+ ##########################
+ install :
+- (strip $(PROGRAM);\
+- install -d $(INSTDIR)/sbin; \
+- install -d $(INSTDIR)/man/man8; \
+- install -m 755 $(PROGRAM) $(INSTDIR)/sbin; \
+- install -m 644 $(PROGRAM).8 $(INSTDIR)/man/man8; \
+- cd watchman; \
+- make install)
++ install -d $(DESTDIR)/bin; \
++ install -d $(DESTDIR)/share/man/man8; \
++ install -m 755 $(PROGRAM) $(DESTDIR)/bin; \
++ install -m 644 $(PROGRAM).8 $(DESTDIR)/share/man/man8
+
Added: procstatd-common-symbols.patch
===================================================================
--- procstatd-common-symbols.patch (rev 0)
+++ procstatd-common-symbols.patch 2021-05-17 20:38:44 UTC (rev 936104)
@@ -0,0 +1,208 @@
+diff --git a/jobslist.c b/jobslist.c
+index 5c6e83c..fe09671 100644
+--- a/jobslist.c
++++ b/jobslist.c
+@@ -2,6 +2,8 @@
+ #include "procstatd.h"
+ #include <dirent.h>
+
++int sendline(int fd, char *buffer, int length);
++
+ #define MAX_BUFFER 4096
+
+ static DIR* dp_proc = NULL;
+diff --git a/procstatd.c b/procstatd.c
+index 3cef9d8..980c73d 100644
+--- a/procstatd.c
++++ b/procstatd.c
+@@ -21,6 +21,27 @@
+ /* void fatal(const char *fmt, ...); */
+ void sigchld_handler(int);
+ char **outfields;
++int sendline(int fd, char *buffer, int length);
++int readline(int fd, char *buffer, int bufsize);
++
++int verbose;
++int daemonmode,port;
++int server_fd, serverlen, client_fd, clientlen;
++int input_fd,output_fd,error_fd;
++int buflen;
++char outbuf[BUFLEN];
++char hostname[BUFLEN];
++char hostip[BUFLEN];
++char clientname[BUFLEN];
++char statbuf[BUFLEN];
++char **fields; /* for parsing via parse() */
++long int interval;
++struct sockaddr_in serverINETaddress;
++struct sockaddr_in clientINETaddress;
++FILE *stat_fd[N_SOURCES];
++FILE *sendstat_fd;
++Stathash stats[N_STATS];
++Kernel kernel;
+
+ int main(int argc, char **argv)
+ {
+diff --git a/procstatd.h b/procstatd.h
+index 5d2b07b..cd03e0a 100644
+--- a/procstatd.h
++++ b/procstatd.h
+@@ -37,6 +37,7 @@
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ #include <sys/un.h>
++#include <sys/wait.h>
+ #include <netinet/in.h>
+ #include <arpa/inet.h>
+ #include <utmp.h>
+@@ -82,24 +83,24 @@ int parse(char *, char **, int, int);
+ * Standard globals. Note we cannot use outbuf for input/strtok as
+ * strtok processes the line in place.
+ */
+- int verbose;
+- int daemonmode,port;
+- int server_fd, serverlen, client_fd, clientlen;
+- int input_fd,output_fd,error_fd;
+- int buflen;
+- char outbuf[BUFLEN];
+- char hostname[BUFLEN];
+- char hostip[BUFLEN];
+- char clientname[BUFLEN];
+- char statbuf[BUFLEN];
+- char **fields; /* for parsing via parse() */
+- long int interval;
++extern int verbose;
++extern int daemonmode,port;
++extern int server_fd, serverlen, client_fd, clientlen;
++extern int input_fd,output_fd,error_fd;
++extern int buflen;
++extern char outbuf[BUFLEN];
++extern char hostname[BUFLEN];
++extern char hostip[BUFLEN];
++extern char clientname[BUFLEN];
++extern char statbuf[BUFLEN];
++extern char **fields; /* for parsing via parse() */
++extern long int interval;
+
+ /*
+ * Globals for socket pair creation
+ */
+- struct sockaddr_in serverINETaddress;
+- struct sockaddr_in clientINETaddress;
++extern struct sockaddr_in serverINETaddress;
++extern struct sockaddr_in clientINETaddress;
+
+ /*
+ * IDENT MUST BE FIRST! This is because it isn't displayed with a unique
+@@ -221,8 +222,8 @@ int parse(char *, char **, int, int);
+ N_MODES
+ } Modes;
+
+- FILE *stat_fd[N_SOURCES];
+- FILE *sendstat_fd;
++extern FILE *stat_fd[N_SOURCES];
++extern FILE *sendstat_fd;
+
+ /*
+ * This is essential. This struct is the one true hash for each statistic.
+@@ -236,7 +237,7 @@ int parse(char *, char **, int, int);
+ double rate; /* (current-previous)/time */
+ } Stathash ;
+
+- Stathash stats[N_STATS];
++extern Stathash stats[N_STATS];
+
+ /*
+ * To handle kernel revisions
+@@ -247,4 +248,4 @@ int parse(char *, char **, int, int);
+ int revision;
+ } Kernel ;
+
+- Kernel kernel;
++extern Kernel kernel;
+diff --git a/procutils.c b/procutils.c
+index b538818..b08d5d5 100644
+--- a/procutils.c
++++ b/procutils.c
+@@ -18,6 +18,8 @@
+
+ #include "procstatd.h"
+
++int sendline(int fd, char *buffer, int length);
++
+ void send_error(char *msg)
+ {
+
+diff --git a/quiklist.c b/quiklist.c
+index 7b46091..5c64510 100644
+--- a/quiklist.c
++++ b/quiklist.c
+@@ -2,6 +2,8 @@
+ #include "procstatd.h"
+ #include <dirent.h>
+
++int sendline(int fd, char *buffer, int length);
++
+ static FILE* fpp_loadavg = NULL;
+ static FILE* fpp_stat = NULL;
+
+diff --git a/senddata.c b/senddata.c
+index f2a2d3c..8702379 100644
+--- a/senddata.c
++++ b/senddata.c
+@@ -18,6 +18,8 @@
+
+ #include "procstatd.h"
+
++int sendline(int fd, char *buffer, int length);
++
+ /*
+ * send_statlist(buffer) prints (as in inetd), transmits (as in
+ * the forking daemon), or broadcast the statistics evaluated with
+diff --git a/statlist.c b/statlist.c
+index bf1eb9c..d0da9b2 100644
+--- a/statlist.c
++++ b/statlist.c
+@@ -18,6 +18,42 @@
+
+ #include "procstatd.h"
+
++void eval_filestuff();
++void eval_ipcstuff();
++void eval_proc_loadavg();
++void eval_proc_lm78();
++void eval_proc_meminfo();
++void eval_proc_net_dev();
++void eval_proc_sensors();
++void eval_proc_stat();
++void eval_proc_uptime();
++void eval_time();
++void eval_users();
++void get_ipcstuff();
++void get_proc_lm78();
++void get_proc_loadavg();
++void get_proc_meminfo();
++void get_proc_net_dev();
++void get_proc_sensors();
++void get_proc_stat();
++void get_proc_uptime();
++void get_filestuff();
++void get_time();
++void get_users();
++void init_filestuff();
++void init_identity();
++void init_proc_lm78();
++void init_proc_loadavg();
++void init_proc_meminfo();
++void init_proc_net_dev();
++void init_proc_sensors();
++void init_proc_stat();
++void init_proc_uptime();
++void init_proc_version();
++void init_time();
++void init_users();
++void init_ipcstuff();
++
+ /*
+ * statlist routines are simple shells that initialize, retrieve, process,
+ * and transmit statistics derived from /proc/* or various systems calls.
More information about the arch-commits
mailing list