chiark / gitweb /
Debianize.
authormdw <mdw>
Fri, 6 May 2005 09:56:28 +0000 (09:56 +0000)
committermdw <mdw>
Fri, 6 May 2005 09:56:28 +0000 (09:56 +0000)
Makefile
debian/changelog [new file with mode: 0644]
debian/control [new file with mode: 0644]
debian/copyright [new file with mode: 0644]
debian/noip.install [new file with mode: 0644]
debian/rules [new file with mode: 0755]
debian/uopen.install [new file with mode: 0644]
noip [deleted file]
withlib.in [moved from uopen with 56% similarity, mode: 0644]

index dcf4b74162e0a72bad93956fcbbd12c19e71161b..eaab421a1ca55df05666ff67e0a107c4caacf4ac 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,17 +1,63 @@
+PACKAGE = preload-hacks
+VERSION = 1.0.0
+
+prefix = /usr/local
+exec_prefix = ${prefix}
+bindir = ${exec_prefix}/bin
+libdir = ${exec_prefix}/lib
+mandir = ${prefix}/man
+man1dir = ${mandir}/man1
+
 CC = gcc
 LD = gcc
 CFLAGS = -O2 -g -fPIC -Wall
 LDFLAGS = -shared
-LIBS = -ldl
+LDLIBS = -ldl
+INST_BIN = install -c -m755
+INST_LIB = install -c -m644
+INST_MAN = install -c -m644
+INST_BIN = install -c -m755
+MKDIRS = install -d -m755
+DESTDIR =
 
-SOURCES = noip.c uopen.c
-TARGETS = noip.so uopen.so
+LIBS = noip.so uopen.so
+MAN1 = $(patsubst %.so, %.1, $(LIBS))
+SCRIPTS = $(patsubst %.so, %, $(LIBS))
+TARGETS = $(LIBS) $(SCRIPTS)
+SOURCES = noip.c uopen.c withlib.in
 all: $(TARGETS)
 %.o: %.c
        $(CC) -c $(CFLAGS) $< -o $@
 noip.so: $(patsubst %.c, %.o, noip.c)
-       $(LD) $(LDFLAGS) $< $(LIBS) -o $@
+       $(LD) $(LDFLAGS) $< $(LDLIBS) -o $@
 uopen.so: $(patsubst %.c, %.o, uopen.c)
-       $(LD) $(LDFLAGS) $< $(LIBS) -o $@
+       $(LD) $(LDFLAGS) $< $(LDLIBS) -o $@
+$(SCRIPTS): withlib.in
+       for i in $(SCRIPTS); do \
+         sed "s/@lib@/$$i/" withlib.in >$$i.new || exit 1; \
+         mv $$i.new $$i || exit 1; \
+       done
+install: all
+       $(MKDIRS) $(addprefix $(DESTDIR), \
+               $(bindir) $(libdir) $(bindir) $(man1dir))
+       $(INST_LIB) $(LIBS) $(DESTDIR)$(libdir)
+       $(INST_BIN) $(SCRIPTS) $(DESTDIR)$(bindir)
+       $(INST_MAN) $(MAN1) $(DESTDIR)$(man1dir)
+uninstall:
+       rm -f $(addprefix $(DESTDIR)$(libdir)/, $(LIBS))
+       rm -f $(addprefix $(DESTDIR)$(bindir)/, $(SCRIPTS))
+       rm -f $(addprefix $(DESTDIR)$(man1dir)/, $(MAN1))
+DISTDIR = $(PACKAGE)-$(VERSION)
+DISTTAR = $(DISTDIR).tar.gz
+distdir:
+       rm -rf $(DISTDIR)
+       mkdir $(DISTDIR)
+       ln $(SOURCES) $(MAN1) Makefile $(DISTDIR)
+       mkdir $(DISTDIR)/debian
+       ln debian/rules debian/copyright debian/changelog debian/control \
+         debian/*.install $(DISTDIR)/debian
+dist: distdir
+       tar chozf $(DISTTAR) $(DISTDIR)
+       rm -rf $(DISTDIR)       
 clean:
-       rm -f $(OBJECTS) $(TARGETS)
\ No newline at end of file
+       rm -f *.o $(OBJECTS) $(TARGETS)
diff --git a/debian/changelog b/debian/changelog
new file mode 100644 (file)
index 0000000..5d6068a
--- /dev/null
@@ -0,0 +1,5 @@
+preload-hacks (1.0.0) experimental; urgency=low
+
+  * Newly written preload hacks, specially for you.
+
+ -- Mark Wooding <mdw@nsict.org>  Fri,  6 May 2005 10:17:24 +0100
diff --git a/debian/control b/debian/control
new file mode 100644 (file)
index 0000000..45018f5
--- /dev/null
@@ -0,0 +1,25 @@
+Source: preload-hacks
+Section: utils
+Priority: extra
+Maintainer: Mark Wooding <mdw@nsict.org>
+Standards-Version: 3.1.1
+
+Package: uopen
+Architecture: any
+Suggests: fw
+Depends: ${shlibs:Depends}
+Description: Automatic connection to Unix-domain sockets
+ uopen is a preload hack which detects attempts to open(2) Unix-domain
+ sockets and connects to the socket instead.  This can be used, for 
+ example, to implement a random-signature daemon.
+
+Package: noip
+Architecture: any
+Depends: ${shlibs:Depends}
+Description: Run programs with limited network access
+ noip is a preload hack which traps socket calls and forces (most)
+ attempts to use TCP/IP to use Unix-domain sockets in a private directory
+ instead.  This can be used to help secure systems which use IP sockets
+ unnecessarily.  It can also be used to limit access to forwarded SSH
+ ports.  Full configuration is available via a file or environment
+ variables.
diff --git a/debian/copyright b/debian/copyright
new file mode 100644 (file)
index 0000000..8337bf2
--- /dev/null
@@ -0,0 +1,16 @@
+Preload-hacks are copyright (c) 2003 Straylight/Edgeware.
+
+Preload-hacks are free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+Preload-hacks are distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have a copy of the GNU General Public License in
+/usr/share/common-licenses/GPL; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+USA.
diff --git a/debian/noip.install b/debian/noip.install
new file mode 100644 (file)
index 0000000..018d14a
--- /dev/null
@@ -0,0 +1,3 @@
+usr/bin/noip
+usr/lib/noip.so
+usr/share/man/man1/noip.1
diff --git a/debian/rules b/debian/rules
new file mode 100755 (executable)
index 0000000..6739f8f
--- /dev/null
@@ -0,0 +1,48 @@
+#! /usr/bin/make -f
+
+export DH_COMPAT = 4
+
+build:
+       make clean
+       make
+       touch build
+
+clean:
+       dh_clean
+       make clean
+
+install: build
+       dh_clean
+       make install \
+         prefix=/usr \
+         mandir=/usr/share/man \
+         DESTDIR=`pwd`/debian/tmp
+       dh_install --sourcedir=debian/tmp
+       rm -rf debian/tmp
+
+binary-indep:
+
+binary-arch: install
+       dh_testdir -a
+       dh_testroot -a
+       dh_compress -a
+       dh_installdocs -a
+       dh_strip -a
+       dh_shlibdeps -a
+       dh_gencontrol -a
+       dh_fixperms -a
+       dh_installdeb -a
+       dh_md5sums -a
+       dh_builddeb -a
+
+binary: binary-indep binary-arch
+
+source:
+       rm -rf deb-dist.tar.gz =deb=
+       make dist DISTTAR=deb-dist.tar.gz
+       mkdir =deb=
+       cd =deb=; tar xvfz ../deb-dist.tar.gz
+       d=`pwd`; cd ..; dpkg-source -i -i'/\.svn/' -b $$d/=deb=/*
+       rm -rf deb-dist.tar.gz =deb=
+
+.PHONY: binary binary-arch binary-indep clean install source 
diff --git a/debian/uopen.install b/debian/uopen.install
new file mode 100644 (file)
index 0000000..cb36fa7
--- /dev/null
@@ -0,0 +1,3 @@
+usr/bin/uopen
+usr/lib/uopen.so
+usr/share/man/man1/uopen.1
diff --git a/noip b/noip
deleted file mode 100755 (executable)
index 7e385f5..0000000
--- a/noip
+++ /dev/null
@@ -1,6 +0,0 @@
-#! /bin/sh
-
-set -e
-export LD_PRELOAD=$LD_PRELOAD${LD_PRELOAD+ }./noip.so
-[ $# -eq 0 ] && set -- "$SHELL"
-exec "$@"
old mode 100755 (executable)
new mode 100644 (file)
similarity index 56%
rename from uopen
rename to withlib.in
index aab9b83..47e19d1
--- a/uopen
@@ -1,6 +1,6 @@
 #! /bin/sh
 
 set -e
-export LD_PRELOAD=$LD_PRELOAD${LD_PRELOAD+ }./uopen.so
+export LD_PRELOAD=$LD_PRELOAD${LD_PRELOAD+ }@lib@.so
 [ $# -eq 0 ] && set -- "${SHELL-/bin/sh}"
 exec "$@"