From 30e1613d6fdf1629c1fe083951ebc386d8d026ba Mon Sep 17 00:00:00 2001 From: dschmenk Date: Sat, 21 Sep 2013 22:52:21 -0700 Subject: [PATCH] Many .deb build changes --- Makefile | 12 ++++++++++-- debian/README.Debian | 5 +++-- debian/README.source | 9 --------- debian/a2pi-doc.docs | 1 - debian/a2pi-doc.install | 1 - debian/a2pi.doc-base | 20 -------------------- debian/changelog | 4 ++-- debian/compat | 0 debian/control | 16 +++++++++------- debian/copyright | 19 ++----------------- debian/dirs | 3 +++ debian/docs | 0 debian/init.d | 29 +++++++++++++++-------------- debian/postinst | 26 ++++++++++++++++++++++++++ debian/prerm | 1 + debian/rules | 4 +++- debian/source/format | 0 debian/watch | 0 {src => share}/11-joy.conf | 0 src/Makefile | 16 +++++++++++++--- src/a2pi-setup.sh | 12 ++++++++++-- 21 files changed, 97 insertions(+), 81 deletions(-) mode change 100755 => 100644 debian/README.Debian delete mode 100755 debian/README.source delete mode 100755 debian/a2pi-doc.docs delete mode 100755 debian/a2pi-doc.install delete mode 100755 debian/a2pi.doc-base mode change 100755 => 100644 debian/changelog mode change 100755 => 100644 debian/compat mode change 100755 => 100644 debian/control mode change 100755 => 100644 debian/copyright create mode 100755 debian/dirs mode change 100755 => 100644 debian/docs mode change 100755 => 100644 debian/init.d mode change 100755 => 100644 debian/postinst mode change 100755 => 100644 debian/prerm mode change 100755 => 100644 debian/source/format mode change 100755 => 100644 debian/watch rename {src => share}/11-joy.conf (100%) diff --git a/Makefile b/Makefile index 4794109..0d543bc 100755 --- a/Makefile +++ b/Makefile @@ -7,6 +7,9 @@ a2pi: $(MAKE) -C src clean: + -rm $(PACKAGE)_* + -rm *.deb + -rm -rf $(DISTDIR) -rm *.tar.gz $(MAKE) -C src clean @@ -14,7 +17,7 @@ install: $(MAKE) -C src install dist: - -rm -rf $(DISTDIR) + $(MAKE) clean mkdir $(DISTDIR) -chmod 777 $(DISTDIR) cp LICENSE.txt $(DISTDIR) @@ -26,4 +29,9 @@ dist: cp -R ./src $(DISTDIR) -chmod -R a+r $(DISTDIR) tar czf $(DIST).tar.gz $(DISTDIR) - rm -rf $(DISTDIR) + +deb: + $(MAKE) dist + mv $(DIST).tar.gz $(PACKAGE)_$(VERSION).orig.tar.gz + cd $(DIST); debuild -us -uc + rm $(PACKAGE)_$(VERSION).orig.tar.gz diff --git a/debian/README.Debian b/debian/README.Debian old mode 100755 new mode 100644 index 216811b..f004102 --- a/debian/README.Debian +++ b/debian/README.Debian @@ -1,6 +1,7 @@ a2pi for Debian --------------- - +Make sure you add your username to groups "fuse" and "input" +for easier installation. - -- David Schmenk Thu, 19 Sep 2013 18:28:32 -0700 + -- David Schmenk Thu, 19 Sep 2013 18:28:32 -0700 diff --git a/debian/README.source b/debian/README.source deleted file mode 100755 index c44ab48..0000000 --- a/debian/README.source +++ /dev/null @@ -1,9 +0,0 @@ -a2pi for Debian ---------------- - - - - - - diff --git a/debian/a2pi-doc.docs b/debian/a2pi-doc.docs deleted file mode 100755 index d4f4542..0000000 --- a/debian/a2pi-doc.docs +++ /dev/null @@ -1 +0,0 @@ -#DOCS# diff --git a/debian/a2pi-doc.install b/debian/a2pi-doc.install deleted file mode 100755 index d4f4542..0000000 --- a/debian/a2pi-doc.install +++ /dev/null @@ -1 +0,0 @@ -#DOCS# diff --git a/debian/a2pi.doc-base b/debian/a2pi.doc-base deleted file mode 100755 index f5679bc..0000000 --- a/debian/a2pi.doc-base +++ /dev/null @@ -1,20 +0,0 @@ -Document: a2pi -Title: Debian a2pi Manual -Author: -Abstract: This manual describes what a2pi is - and how it can be used to - manage online manuals on Debian systems. -Section: unknown - -Format: debiandoc-sgml -Files: /usr/share/doc/a2pi/a2pi.sgml.gz - -Format: postscript -Files: /usr/share/doc/a2pi/a2pi.ps.gz - -Format: text -Files: /usr/share/doc/a2pi/a2pi.text.gz - -Format: HTML -Index: /usr/share/doc/a2pi/html/index.html -Files: /usr/share/doc/a2pi/html/*.html diff --git a/debian/changelog b/debian/changelog old mode 100755 new mode 100644 index ee281f0..e2406fe --- a/debian/changelog +++ b/debian/changelog @@ -1,5 +1,5 @@ a2pi (0.9.0-1) unstable; urgency=low - * Initial release (Closes: #nnnn) + * Initial release (Closes: #0901) - -- David Schmenk Thu, 19 Sep 2013 18:28:32 -0700 + -- David Schmenk Thu, 19 Sep 2013 18:28:32 -0700 diff --git a/debian/compat b/debian/compat old mode 100755 new mode 100644 diff --git a/debian/control b/debian/control old mode 100755 new mode 100644 index 7fc12cc..5b50535 --- a/debian/control +++ b/debian/control @@ -1,21 +1,23 @@ Source: a2pi Section: unknown Priority: extra -Maintainer: David Schmenk +Maintainer: David Schmenk Build-Depends: debhelper (>= 8.0.0), libfuse-dev (>= 2.9.0) Standards-Version: 3.9.3 Homepage: http://schmenk.is-a-geek.com -#Vcs-Git: git://git.debian.org/collab-maint/a2pi.git -#Vcs-Browser: http://git.debian.org/?p=collab-maint/a2pi.git;a=summary +#Vcs-Git: https://github.com/dschmenk/apple2pi.git +#Vcs-Crowser: https://github.com/dschmenk/apple2pi Package: a2pi Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends}, libfuse2 (>= 2.9.0) -Description: Apple II Pi daemon and utilites +Depends: ${misc:Depends}, libfuse2 (>= 2.9.0) +Description: Apple II Pi daemon and utilities Apple II Pi is a suite of programs to integrate an Apple II with the Raspberry Pi. Package: a2pi-doc +Section: doc Architecture: all -Description: documentation for a2pi - Apple II Pi documentaton and sample code. +Description: documentation and sample code for Apple II Pi + Apple II Pi is a suite of programs to integrate an Apple II with + the Raspberry Pi. diff --git a/debian/copyright b/debian/copyright old mode 100755 new mode 100644 index c03d1d5..ef07f04 --- a/debian/copyright +++ b/debian/copyright @@ -1,20 +1,9 @@ Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: a2pi -Source: +Source: Files: * -Copyright: - -License: - - - . - - -# If you want to use GPL v2 or later for the /debian/* files use -# the following clauses, or change it to suit. Delete these two lines -Files: debian/* -Copyright: 2013 David Schmenk +Copyright: 2013 David Schmenk License: GPL-2+ This package is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -32,7 +21,3 @@ License: GPL-2+ On Debian systems, the complete text of the GNU General Public License version 2 can be found in "/usr/share/common-licenses/GPL-2". -# Please also look if there are files or directories which have a -# different copyright/license attached and list them here. -# Please avoid to pick license terms that are more restrictive than the -# packaged work, as it may make Debian's contributions unacceptable upstream. diff --git a/debian/dirs b/debian/dirs new file mode 100755 index 0000000..3a3cc3f --- /dev/null +++ b/debian/dirs @@ -0,0 +1,3 @@ +usr/share +usr/bin +sbin diff --git a/debian/docs b/debian/docs old mode 100755 new mode 100644 diff --git a/debian/init.d b/debian/init.d old mode 100755 new mode 100644 index f5a4235..2de53d8 --- a/debian/init.d +++ b/debian/init.d @@ -1,24 +1,25 @@ #!/bin/sh ### BEGIN INIT INFO -# Provides: a2pi -# Required-Start: $network $local_fs -# Required-Stop: +# Provides: a2pid +# Required-Start: $local_fs $remote_fs +# Required-Stop: $local_fs $remote_fs # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 -# Short-Description: -# Description: -# <...> -# <...> +# Short-Description: Apple II Pi communications server +# Description: a2pid is the server that initiates communication +# with the Apple II to provide keyboard and mouse +# input as well as be the gatekeeper for other +# programs to interact with the Apple II. ### END INIT INFO -# Author: David Schmenk +# Author: David Schmenk # PATH should only include /usr/* if it runs after the mountnfs.sh script PATH=/sbin:/usr/sbin:/bin:/usr/bin -DESC=a2pi # Introduce a short description here -NAME=a2pi # Introduce the short server's name here -DAEMON=/usr/sbin/a2pi # Introduce the server's location here -DAEMON_ARGS="" # Arguments to run the daemon with +DESC=a2pid # Introduce a short description here +NAME=a2pid # Introduce the short server's name here +DAEMON=/usr/sbin/a2pid # Introduce the server's location here +DAEMON_ARGS="--daemon" # Arguments to run the daemon with PIDFILE=/var/run/$NAME.pid SCRIPTNAME=/etc/init.d/$NAME @@ -44,14 +45,14 @@ do_start() # 0 if daemon has been started # 1 if daemon was already running # 2 if daemon could not be started - start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \ - || return 1 + #start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null || return 1 start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \ $DAEMON_ARGS \ || return 2 # Add code here, if necessary, that waits for the process to be ready # to handle requests from services started subsequently which depend # on this one. As a last resort, sleep for some time. + wait 1 } # diff --git a/debian/postinst b/debian/postinst old mode 100755 new mode 100644 index 1a61d2b..1849ac1 --- a/debian/postinst +++ b/debian/postinst @@ -20,6 +20,32 @@ set -e case "$1" in configure) + # + # Update /boot partition files. + # + ttyline=`grep ttyAMA0 /boot/cmdline.txt` + if [ "$ttyline" != "" ] ; then + mv /boot/cmdline.txt /boot/cmdline.bak + echo "dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait" > /boot/cmdline.txt + fi + # + # Disable getty on built-in serial port. + # + ttyline=`grep ttyAMA0 /etc/inittab` + case "$gettyline" in + T*) + mv /etc/inittab /etc/inittab.bak + sed 's/^T0*/#T0*/' /etc/inittab.bak > /etc/inittab + ;; + *) + ;; + esac + # + # Disable joystick as a mouse in X + # + if [ -d /usr/share/X11/xorg.conf.d ] ; then + cp /usr/share/a2pi/11-joy.conf /usr/share/X11/xorg.conf.d + fi ;; abort-upgrade|abort-remove|abort-deconfigure) diff --git a/debian/prerm b/debian/prerm old mode 100755 new mode 100644 index 8237f5d..9fb8688 --- a/debian/prerm +++ b/debian/prerm @@ -31,6 +31,7 @@ case "$1" in rm /usr/local/bin/a2mount rm /usr/local/bin/bload rm /usr/local/bin/brun + rm /usr/local/sbin/a2pid ;; failed-upgrade) diff --git a/debian/rules b/debian/rules index ff50c2a..04bb076 100755 --- a/debian/rules +++ b/debian/rules @@ -11,7 +11,7 @@ # build-arch and build-indep targets by Bill Allombert 2001 # Uncomment this to turn on verbose mode. -#export DH_VERBOSE=1 +export DH_VERBOSE=1 # This has to be exported to make some magic below work. export DH_OPTIONS @@ -20,3 +20,5 @@ export DH_OPTIONS %: dh $@ +override_dh_auto_install: + $(MAKE) DESTDIR=$$(pwd)/debian/a2pi install diff --git a/debian/source/format b/debian/source/format old mode 100755 new mode 100644 diff --git a/debian/watch b/debian/watch old mode 100755 new mode 100644 diff --git a/src/11-joy.conf b/share/11-joy.conf similarity index 100% rename from src/11-joy.conf rename to share/11-joy.conf diff --git a/src/Makefile b/src/Makefile index cb02d88..09e0bd7 100755 --- a/src/Makefile +++ b/src/Makefile @@ -1,10 +1,17 @@ DESTDIR=/usr/local +SBINDIR=$(DESTDIR)/sbin +ifneq "$(findstring environment,$(origin DESTDIR))" "" BINDIR=$(DESTDIR)/bin SHAREDIR=$(DESTDIR)/share/a2pi -BIN=a2pid a2joy a2joymou a2joypad a2mon a2term fusea2pi dskread dskwrite bload brun +else +BINDIR=$(DESTDIR)/usr/bin +SHAREDIR=$(DESTDIR)/usr/share/a2pi +endif +BIN=a2joy a2joymou a2joypad a2mon a2term fusea2pi dskread dskwrite bload brun +SBIN=a2pid A2PIDEFS=-DSETSERCLK -all: $(BIN) +all: $(BIN) $(SBIN) a2pid: a2pid.c gpclk.c $(CC) $(A2PIDEFS) a2pid.c -o a2pid @@ -13,13 +20,16 @@ fusea2pi: fusea2pi.c a2lib.c $(CC) -I/usr/include/fuse -D_FILE_OFFSET_BITS=64 fusea2pi.c -lfuse -o fusea2pi clean: - -rm $(BIN) *~ *.tar.gz + -rm $(BIN) $(SBIN) *~ *.tar.gz install: -mkdir -p $(BINDIR) cp $(BIN) a2mount $(BINDIR) + -mkdir -p $(SBINDIR) + cp $(SBIN) $(SBINDIR) -mkdir -p $(SHAREDIR) cp ../share/* $(SHAREDIR) uninstall: cd $(BINDIR); rm $(BIN) a2mount + cd $(SBINDIR); rm $(SBIN) diff --git a/src/a2pi-setup.sh b/src/a2pi-setup.sh index aa8f6f9..5e294f2 100755 --- a/src/a2pi-setup.sh +++ b/src/a2pi-setup.sh @@ -20,17 +20,25 @@ fi if [ -f /etc/rc.local ] ; then if ! grep a2pid /etc/rc.local > /dev/null ; then mv /etc/rc.local /etc/rc.local.bak - sed -e '/^exit/i\# Start Apple II Pi' -e '/^exit/i\/usr/local/bin/a2pid --daemon' -e '/^exit/i\wait 1' -e '/^exit/i\/usr/local/bin/a2joy' /etc/rc.local.bak > /etc/rc.local + sed -e '/^exit/i\# Start Apple II Pi' -e '/^exit/i\/usr/local/sbin/a2pid --daemon' -e '/^exit/i\wait 1' -e '/^exit/i\/usr/local/bin/a2joy' /etc/rc.local.bak > /etc/rc.local chmod +x /etc/rc.local fi fi # # Disable joystick as a mouse in X # -cp 11-joy.conf /usr/share/X11/xorg.conf.d +if [ -d /usr/share/X11/xorg.conf.d ] ; then + cp 11-joy.conf /usr/share/X11/xorg.conf.d +fi # # Make sure a2mount is executable # if [ -f /usr/local/bin/a2mount ] ; then chmod +x /usr/local/bin/a2mount fi +# +# Remove old a2pid +# +if [ -f /usr/local/bin/apid ] ; then + rm /usr/local/bin/a2pid +fi