From 8a918fe41b82ddd796542c92fa1c951e91ca8785 Mon Sep 17 00:00:00 2001 From: Gregor Riepl Date: Tue, 27 Jul 2010 22:33:17 +0200 Subject: [PATCH] =?utf8?q?Added=20dpkg=20packaging=20info=20Added=20DESTDIR=C2?= =?utf8?q?=A0capability=20to=20makefile?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- Makefile | 12 +++---- debian/changelog | 6 ++++ debian/compat | 1 + debian/control | 24 +++++++++++++ debian/copyright | 26 ++++++++++++++ debian/dirs | 2 ++ debian/docs | 1 + debian/manpage.8.ex | 42 ++++++++++++++++++++++ debian/postinst.ex | 42 ++++++++++++++++++++++ debian/prerm.ex | 41 +++++++++++++++++++++ debian/rules | 98 +++++++++++++++++++++++++++++++++++++++++++++++++++ 11 files changed, 289 insertions(+), 6 deletions(-) create mode 100644 debian/changelog create mode 100644 debian/compat create mode 100644 debian/control create mode 100644 debian/copyright create mode 100644 debian/dirs create mode 100644 debian/docs create mode 100644 debian/manpage.8.ex create mode 100644 debian/postinst.ex create mode 100644 debian/prerm.ex create mode 100755 debian/rules diff --git a/Makefile b/Makefile index 5cc417f..fa9330f 100644 --- a/Makefile +++ b/Makefile @@ -14,14 +14,14 @@ clean: rm -f *.o mtetherd install: mtetherd - install -m 755 -D mtetherd $(PREFIX)/sbin/mtetherd - install -m 644 -D event.d-mtetherd /etc/event.d/mtetherd - install -m 644 -D README $(PREFIX)/share/doc/mtetherd/README + install -m 755 -D mtetherd $(DESTDIR)/$(PREFIX)/sbin/mtetherd + install -m 644 -D event.d-mtetherd $(DESTDIR)/etc/event.d/mtetherd + install -m 644 -D README $(DESTDIR)/$(PREFIX)/share/doc/mtetherd/README uninstall: - rm -f $(PREFIX)/sbin/mtetherd - rm -f /etc/event.d/mtetherd - rm -rf $(PREFIX)/share/doc/mtetherd + rm -f $(DESTDIR)/$(PREFIX)/sbin/mtetherd + rm -f $(DESTDIR)/etc/event.d/mtetherd + rm -rf $(DESTDIR)/$(PREFIX)/share/doc/mtetherd %.o: %.c $(CC) $(CFLAGS) $(INCLUDES) -o $@ -c $^ diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..bc8abe1 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,6 @@ +mtetherd (0.1-1) unstable; urgency=low + + * Initial release + + -- Gregor Riepl Fri, 23 Jul 2010 21:28:22 +0200 + diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..7ed6ff8 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +5 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..a4a7b08 --- /dev/null +++ b/debian/control @@ -0,0 +1,24 @@ +Source: mtetherd +Section: user/system +Priority: optional +Maintainer: Gregor Riepl +Build-Depends: debhelper (>= 5) +Standards-Version: 3.7.2 + +Package: mtetherd +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} iptables (>= 1.4.6), bluetooth-dun (>= 1.1), dnsmasq (>= 2.45) +Description: Enable tethering via USB networking and Bluetooth PAN + mtetherd allows you to use your N900 as an Internet router. + Once a USB network or Bluetooth PAN connection is opened to the device, + it will automatically configure networking and start a dnsmasq instance + that serves DHCP requests and forwards DNS queries. + You can also use it to automatically configure network interfaces + for development. + . + To use tethering via USB, you also need mad-developer installed to + activate g_ether, or you can do it manually via the console. + . + You can connect to your N900 through the following IPs: + USB: 192.168.253.254 + Bluetooth: 192.168.254.254 diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..bec33fe --- /dev/null +++ b/debian/copyright @@ -0,0 +1,26 @@ +This package was debianized by Gregor Riepl on +Fri, 23 Jul 2010 21:28:22 +0200. + +Copyright: (c) 2010 Gregor Riepl + +License: + + This program is 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 3 of the License, or + (at your option) any later version. + + This program is 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 received a copy of the GNU General Public License + along with this program. If not, see . + +On Debian systems, the complete text of the GNU General +Public License can be found in `/usr/share/common-licenses/GPL-3'. + +The Debian packaging is (c) 2010, Gregor Riepl and +is licensed under the GPLv3, see above. + diff --git a/debian/dirs b/debian/dirs new file mode 100644 index 0000000..dc34a69 --- /dev/null +++ b/debian/dirs @@ -0,0 +1,2 @@ +usr/sbin +etc/event.d diff --git a/debian/docs b/debian/docs new file mode 100644 index 0000000..e845566 --- /dev/null +++ b/debian/docs @@ -0,0 +1 @@ +README diff --git a/debian/manpage.8.ex b/debian/manpage.8.ex new file mode 100644 index 0000000..cc5cfef --- /dev/null +++ b/debian/manpage.8.ex @@ -0,0 +1,42 @@ +.\" Hey, EMACS: -*- nroff -*- +.\" First parameter, NAME, should be all caps +.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection +.\" other parameters are allowed: see man(7), man(1) +.TH MTETHERD 8 "July 23, 2010" +.\" Please adjust this date whenever revising the manpage. +.\" +.\" Some roff macros, for reference: +.\" .nh disable hyphenation +.\" .hy enable hyphenation +.\" .ad l left justify +.\" .ad b justify to both left and right margins +.\" .nf disable filling +.\" .fi enable filling +.\" .br insert line break +.\" .sp insert n+1 empty lines +.\" for manpage-specific macros, see man(7) +.SH NAME +mtetherd \- Maemo tethering daemon +.SH SYNOPSIS +.B start mtetherd +.br +.B stop mtetherd +.SH DESCRIPTION +.B mtetherd +allows you to use your N900 as an Internet router. +Once a USB network or Bluetooth PAN connection is opened to the device, +it will automatically configure networking and start a dnsmasq instance +that serves DHCP requests and forwards DNS queries. +You can also use it to automatically configure network interfaces +for development. +.SH IP ADDRESSES +.SS USB +N900: 192.168.253.254 +.br +Host: 192.168.253.1 - 192.168.253.253 +.SS Bluetooth +N900: 192.168.254.254 +.br +Host: 192.168.254.1 - 192.168.254.253 +.SH AUTHOR +mtetherd was written by Gregor Riepl . diff --git a/debian/postinst.ex b/debian/postinst.ex new file mode 100644 index 0000000..47c10de --- /dev/null +++ b/debian/postinst.ex @@ -0,0 +1,42 @@ +#!/bin/sh +# postinst script for mtetherd +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `configure' +# * `abort-upgrade' +# * `abort-remove' `in-favour' +# +# * `abort-remove' +# * `abort-deconfigure' `in-favour' +# `removing' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + configure) + start mtetherd + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 + + diff --git a/debian/prerm.ex b/debian/prerm.ex new file mode 100644 index 0000000..7c63929 --- /dev/null +++ b/debian/prerm.ex @@ -0,0 +1,41 @@ +#!/bin/sh +# prerm script for mtetherd +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `remove' +# * `upgrade' +# * `failed-upgrade' +# * `remove' `in-favour' +# * `deconfigure' `in-favour' +# `removing' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + remove|upgrade|deconfigure) + stop mtetherd + ;; + + failed-upgrade) + ;; + + *) + echo "prerm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 + + diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..03df8f4 --- /dev/null +++ b/debian/rules @@ -0,0 +1,98 @@ +#!/usr/bin/make -f +# -*- makefile -*- +# Sample debian/rules that uses debhelper. +# This file was originally written by Joey Hess and Craig Small. +# As a special exception, when this file is copied by dh-make into a +# dh-make output file, you may use that output file without restriction. +# This special exception was added by Craig Small in version 0.37 of dh-make. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + + + + +CFLAGS = -Wall -g + +ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) + CFLAGS += -O0 +else + CFLAGS += -O2 +endif + +configure: configure-stamp +configure-stamp: + dh_testdir + # Add here commands to configure the package. + + touch configure-stamp + + +build: build-stamp + +build-stamp: configure-stamp + dh_testdir + + # Add here commands to compile the package. + $(MAKE) + #docbook-to-man debian/mtetherd.sgml > mtetherd.1 + + touch $@ + +clean: + dh_testdir + dh_testroot + rm -f build-stamp configure-stamp + + # Add here commands to clean up after the build process. + -$(MAKE) clean + + dh_clean + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + + # Add here commands to install the package into debian/mtetherd. + $(MAKE) DESTDIR=$(CURDIR)/debian/mtetherd install + + +# Build architecture-independent files here. +binary-indep: build install +# We have nothing to do by default. + +# Build architecture-dependent files here. +binary-arch: build install + dh_testdir + dh_testroot + dh_installchangelogs + dh_installdocs + dh_installexamples +# dh_install +# dh_installmenu +# dh_installdebconf +# dh_installlogrotate +# dh_installemacsen +# dh_installpam +# dh_installmime +# dh_python +# dh_installinit +# dh_installcron +# dh_installinfo + dh_installman + dh_link + dh_strip + dh_compress + dh_fixperms +# dh_perl +# dh_makeshlibs + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install configure -- 1.7.9.5