diff options
author | schmonz <schmonz@pkgsrc.org> | 2018-11-12 17:54:40 +0000 |
---|---|---|
committer | schmonz <schmonz@pkgsrc.org> | 2018-11-12 17:54:40 +0000 |
commit | a464e20861ae75f6151fcc5b1d5fb1bf4906b205 (patch) | |
tree | 3ed51bd2c01766df5fb9d4ca12431c02eb465d91 | |
parent | 5b1b77ca6ad2cbd124db0a47327d9c13943d7902 (diff) | |
download | pkgsrc-a464e20861ae75f6151fcc5b1d5fb1bf4906b205.tar.gz |
Refactor libtoolization: integrate it into the upstream Makefile.
No visible change on NetBSD, CentOS 6, OS X 10.14.
-rw-r--r-- | devel/syncdir/Makefile | 14 | ||||
-rw-r--r-- | devel/syncdir/distinfo | 4 | ||||
-rw-r--r-- | devel/syncdir/patches/patch-Makefile | 67 | ||||
-rw-r--r-- | devel/syncdir/patches/patch-testsync.c | 15 |
4 files changed, 87 insertions, 13 deletions
diff --git a/devel/syncdir/Makefile b/devel/syncdir/Makefile index d3cb8de8f25..64b5c830108 100644 --- a/devel/syncdir/Makefile +++ b/devel/syncdir/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.11 2017/07/20 02:07:27 schmonz Exp $ +# $NetBSD: Makefile,v 1.12 2018/11/12 17:54:40 schmonz Exp $ # DISTNAME= syncdir-1.0 @@ -8,7 +8,7 @@ MASTER_SITES= ${HOMEPAGE} MAINTAINER= schmonz@NetBSD.org HOMEPAGE= http://untroubled.org/syncdir/ -COMMENT= Implementation of open, link, rename, and unlink +COMMENT= Synchronous open, link, rename, and unlink LICENSE= gnu-gpl-v2 USE_LIBTOOL= yes @@ -24,14 +24,4 @@ SUBST_FILES.fsync= syncdir.c SUBST_SED.fsync= -e 's|syscall(SYS_fsync, FD)|fsync(FD)|' .endif -do-build: - cd ${WRKSRC} && ${LIBTOOL} --mode=compile ${CC} ${CFLAGS} -c syncdir.c - cd ${WRKSRC} && ${LIBTOOL} --mode=link ${CC} ${LDFLAGS} \ - -o libsyncdir.la syncdir.lo \ - -version-info 1:0:0 -rpath ${PREFIX}/lib - -do-install: - cd ${WRKSRC} && ${LIBTOOL} --mode=install ${INSTALL_LIB} \ - -c libsyncdir.la ${DESTDIR}${PREFIX}/lib/libsyncdir.la - .include "../../mk/bsd.pkg.mk" diff --git a/devel/syncdir/distinfo b/devel/syncdir/distinfo index 394d55599ea..0150f189300 100644 --- a/devel/syncdir/distinfo +++ b/devel/syncdir/distinfo @@ -1,7 +1,9 @@ -$NetBSD: distinfo,v 1.5 2017/07/20 03:21:16 schmonz Exp $ +$NetBSD: distinfo,v 1.6 2018/11/12 17:54:40 schmonz Exp $ SHA1 (syncdir-1.0.tar.gz) = fdc3e282acd4af15e9bffb343ee825d69dde162e RMD160 (syncdir-1.0.tar.gz) = b032a8481529c54b4ac149fdf98ad888e0a392f0 SHA512 (syncdir-1.0.tar.gz) = 0b5262e23e43f34be7bc31ed6baf7624a115a509e459504651b184a0856c7918671db4be1b8e14552f275c49c5c6bbc00d786c57f1d96548a491048674f58317 Size (syncdir-1.0.tar.gz) = 8878 bytes +SHA1 (patch-Makefile) = ed9063d6359f4dc8cf905cb85b14e830a65832d9 SHA1 (patch-syncdir.c) = eb289d0fd2fa29adb941899603835a14df4bc4f0 +SHA1 (patch-testsync.c) = 03f536c6ba1af64c9dca6735ce8cc58a1270bc3f diff --git a/devel/syncdir/patches/patch-Makefile b/devel/syncdir/patches/patch-Makefile new file mode 100644 index 00000000000..d6e2910ab4f --- /dev/null +++ b/devel/syncdir/patches/patch-Makefile @@ -0,0 +1,67 @@ +$NetBSD: patch-Makefile,v 1.1 2018/11/12 17:54:40 schmonz Exp $ + +Libtoolize for portability. + +--- Makefile.orig 1998-07-13 19:33:23.000000000 +0000 ++++ Makefile +@@ -1,34 +1,33 @@ + VERSION = 1.0 + +-CFLAGS = -O2 -Wall -g +-CC = gcc +-LDFLAGS = +-LD = $(CC) +-prefix = /usr ++CFLAGS ?= -O2 -Wall -g ++CC ?= gcc ++LDFLAGS ?= ++LD ?= $(CC) ++prefix = $(PREFIX) + libdir = $(prefix)/lib + +-OBJS = syncdir.o + LOBJS = syncdir.lo + +-all: libsyncdir.so libsyncdir.a ++LIBTOOL = libtool --tag=CC + +-testsync: testsync.o libsyncdir.a +- $(LD) $(LDFLAGS) -o $@ $< libsyncdir.a ++all: libsyncdir.la + +-libsyncdir.so: $(LOBJS) +- $(LD) $(LDFLAGS) -shared -Wl,-soname,libsyncdir.so \ +- -o libsyncdir.so $(LOBJS) ++.SUFFIXES: .lo ++.c.lo: ++ $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c -o $@ $< + +-syncdir.lo: syncdir.c +- $(CC) $(CFLAGS) -fPIC -DPIC -o $@ -c $< +-syncdir.o: syncdir.c ++testsync: testsync.lo libsyncdir.la ++ $(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -o $@ $< libsyncdir.la + +-libsyncdir.a: $(OBJS) +- ar r libsyncdir.a $(OBJS) ++libsyncdir.la: libtool-version-info $(LOBJS) ++ $(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -o $@ $(LOBJS) -version-info `cat libtool-version-info` -rpath $(libdir) ++ ++libtool-version-info: ++ echo $(VERSION) | awk -F. '{ printf "%d:%d:0", $$1, $$2 }' > $@ + + install: all +- install -m 755 libsyncdir.so $(libdir) +- install -m 644 libsyncdir.a $(libdir) ++ $(LIBTOOL) --mode=install $(BSD_INSTALL_LIB) libsyncdir.la $(DESTDIR)$(libdir) + + TARGET = syncdir-$(VERSION) + FILES = Makefile COPYING syncdir.c syncdir.spec testsync.c +@@ -39,5 +38,5 @@ distrib: + $(RM) -r $(TARGET) + + clean: +- $(RM) core *.o *.lo *.so *.a testsync $(TARGET).tar.gz +- ++ $(RM) libtool-version-info core *.o *.lo *.la *.so *.a testsync $(TARGET).tar.gz ++ $(RM) -r .libs diff --git a/devel/syncdir/patches/patch-testsync.c b/devel/syncdir/patches/patch-testsync.c new file mode 100644 index 00000000000..4414da1224b --- /dev/null +++ b/devel/syncdir/patches/patch-testsync.c @@ -0,0 +1,15 @@ +$NetBSD: patch-testsync.c,v 1.1 2018/11/12 17:54:40 schmonz Exp $ + +Libtoolize. + +--- testsync.c.orig 1998-07-13 19:43:05.000000000 +0000 ++++ testsync.c +@@ -2,7 +2,7 @@ + #include <fcntl.h> + #include <string.h> + +-inline void msg(const char* m) ++void msg(const char* m) + { + write(1, m, strlen(m)); + } |