Browse Source

Merge pull request #99 from hagen-i2p/debian

Debian package metadata
pull/100/head
orignal 10 years ago
parent
commit
cbc3d24800
  1. 19
      Makefile
  2. 21
      Makefile.bsd
  3. 25
      Makefile.linux
  4. 23
      Makefile.osx
  5. 11
      debian/changelog
  6. 1
      debian/compat
  7. 21
      debian/control
  8. 28
      debian/copyright
  9. 1
      debian/docs
  10. 7
      debian/i2pd.default
  11. 1
      debian/i2pd.install
  12. 116
      debian/init.d
  13. 25
      debian/patches/rename-binary.patch
  14. 1
      debian/patches/series
  15. 14
      debian/rules
  16. 1
      debian/source/format
  17. 3
      debian/watch

19
Makefile

@ -8,3 +8,22 @@ else
include Makefile.linux include Makefile.linux
endif endif
all: obj i2p
i2p: $(OBJECTS:obj/%=obj/%)
$(CC) -o $@ $^ $(LDFLAGS) $(LIBS)
.SUFFIXES:
.SUFFIXES: .c .cc .C .cpp .o
obj/%.o : %.cpp
$(CC) -o $@ $< -c $(CFLAGS) $(INCFLAGS) $(CPU_FLAGS)
obj:
mkdir -p obj
clean:
rm -fr obj i2p
.PHONY: all
.PHONY: clean

21
Makefile.bsd

@ -4,24 +4,3 @@ include filelist.mk
INCFLAGS = -I/usr/include/ -I/usr/local/include/ INCFLAGS = -I/usr/include/ -I/usr/local/include/
LDFLAGS = -Wl,-rpath,/usr/local/lib -L/usr/local/lib -lcryptopp -lboost_system -lboost_date_time -lboost_filesystem -lboost_regex -lboost_program_options -lpthread LDFLAGS = -Wl,-rpath,/usr/local/lib -L/usr/local/lib -lcryptopp -lboost_system -lboost_date_time -lboost_filesystem -lboost_regex -lboost_program_options -lpthread
LIBS = LIBS =
all: obj i2p
i2p: $(OBJECTS:obj/%=obj/%)
$(CC) -o $@ $^ $(LDFLAGS) $(LIBS)
.SUFFIXES:
.SUFFIXES: .c .cc .C .cpp .o
obj/%.o : %.cpp
$(CC) -o $@ $< -c $(CFLAGS) $(INCFLAGS) $(CPU_FLAGS)
obj:
mkdir -p obj
clean:
rm -fr obj i2p
.PHONY: all
.PHONY: clean

25
Makefile.linux

@ -1,9 +1,8 @@
CC = g++ CC = g++
CFLAGS = -g -Wall -std=c++0x CFLAGS = -g -Wall -std=c++11
include filelist.mk include filelist.mk
INCFLAGS = INCFLAGS =
LDFLAGS = -Wl,-rpath,/usr/local/lib -lcryptopp -lboost_system -lboost_date_time -lboost_filesystem -lboost_regex -lboost_program_options -lpthread LDFLAGS = -lcryptopp -lboost_system -lboost_date_time -lboost_filesystem -lboost_regex -lboost_program_options -lpthread
LIBS = LIBS =
#check if AES-NI is supported by CPU #check if AES-NI is supported by CPU
@ -11,23 +10,3 @@ ifneq ($(shell grep -c aes /proc/cpuinfo),0)
CPU_FLAGS = -maes -DAESNI CPU_FLAGS = -maes -DAESNI
endif endif
all: obj i2p
i2p: $(OBJECTS:obj/%=obj/%)
$(CC) -o $@ $^ $(LDFLAGS) $(LIBS)
.SUFFIXES:
.SUFFIXES: .c .cc .C .cpp .o
obj/%.o : %.cpp
$(CC) -o $@ $< -c $(CFLAGS) $(INCFLAGS) $(CPU_FLAGS)
obj:
mkdir -p obj
clean:
rm -fr obj i2p
.PHONY: all
.PHONY: clean

23
Makefile.osx vendored

@ -9,30 +9,9 @@ LIBS =
# http://www.hutsby.net/2011/08/macs-with-aes-ni.html # http://www.hutsby.net/2011/08/macs-with-aes-ni.html
# Seems like all recent Mac's have AES-NI, after firmware upgrade 2.2 # Seems like all recent Mac's have AES-NI, after firmware upgrade 2.2
# Found no good way to detect it from command line. TODO: Might be some osx sysinfo magic # Found no good way to detect it from command line. TODO: Might be some osx sysinfo magic
CPU_FLAGS = -DAESNI CFLAGS += -DAESNI
# Apple Mac OSX # Apple Mac OSX
UNAME_S := $(shell uname -s) UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Darwin) ifeq ($(UNAME_S),Darwin)
endif endif
all: obj i2p
i2p: $(OBJECTS:obj/%=obj/%)
$(CC) -o $@ $^ $(LDFLAGS) $(LIBS)
.SUFFIXES:
.SUFFIXES: .c .cc .C .cpp .o
obj/%.o : %.cpp
$(CC) -o $@ $< -c $(CFLAGS) $(INCFLAGS) $(CPU_FLAGS)
obj:
mkdir -p obj
clean:
rm -fr obj i2p
.PHONY: all
.PHONY: clean

11
debian/changelog vendored

@ -0,0 +1,11 @@
i2pd (20140919-2) unstable; urgency=low
* updated to latest sources
-- hagen <hagen@i2pmail.org> Fri, 19 Sep 2014 05:16:12 +0000
i2pd (20140919-1) unstable; urgency=low
* Initial release (Closes: #nnnn)
-- hagen <hagen@i2pmail.org> Mon, 19 Sep 2014 00:00:00 +0000

1
debian/compat vendored

@ -0,0 +1 @@
8

21
debian/control vendored

@ -0,0 +1,21 @@
Source: i2pd
Section: net
Priority: extra
Maintainer: hagen <hagen@i2pmail.org>
Build-Depends: debhelper (>= 8.0.0), cmake, dpkg-dev (>= 1.16.1~),
libboost-regex-dev,
libboost-system-dev (>= 1.46),
libboost-date-time-dev,
libboost-filesystem-dev,
libboost-program-options-dev,
libcrypto++-dev
Standards-Version: 3.9.3
Homepage: https://github.com/PrivacySolutions/i2pd
Vcs-Git: git://github.com/PrivacySolutions/i2pd.git
Vcs-Browser: https://github.com/PrivacySolutions/i2pd.git
Package: i2pd
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: i2p router written in C++
Mainly runs on linux, but also supports OSX, BSD and Windows

28
debian/copyright vendored

@ -0,0 +1,28 @@
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: i2pd
Source: https://github.com/PrivacySolutions
Files: *
Copyright: 2013-2014 PrivacySolutions <press@privacysolutions.no>
License: GPL-2.0+
Files: debian/*
Copyright: 2014 hagen <hagen@i2pmail.org>
License: GPL-2.0+
License: GPL-2.0+
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
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
.
This package 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 <http://www.gnu.org/licenses/>
.
On Debian systems, the complete text of the GNU General
Public License version 2 can be found in "/usr/share/common-licenses/GPL-2".

1
debian/docs vendored

@ -0,0 +1 @@
README.md

7
debian/i2pd.default vendored

@ -0,0 +1,7 @@
# Defaults for i2pd initscript
# sourced by /etc/init.d/i2pd
# installed at /etc/default/i2pd by the maintainer scripts
# Additional options that are passed to the Daemon.
DAEMON_OPTS="--host=1.2.3.4 --port=4567"
# change ip and port above to your external address and port

1
debian/i2pd.install vendored

@ -0,0 +1 @@
i2pd usr/sbin/

116
debian/init.d vendored

@ -0,0 +1,116 @@
#!/bin/sh
### BEGIN INIT INFO
# Provides: i2pd
# Required-Start: $network $local_fs $remote_fs
# Required-Stop: $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: i2p router written in C++
### END INIT INFO
# Author: hagen <hagen@i2pmail.org>
PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC=i2pd # Introduce a short description here
NAME=i2pd # Introduce the short server's name here
DAEMON=/usr/sbin/i2pd # Introduce the server's location here
DAEMON_OPTS="" # Arguments to run the daemon with
PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME
# Exit if the package is not installed
[ -x $DAEMON ] || exit 0
[ -r /etc/default/$NAME ] && . /etc/default/$NAME
. /lib/init/vars.sh
. /lib/lsb/init-functions
# Function that starts the daemon/service
do_start()
{
# Return
# 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 -- \
--daemon=1 --log=1 $DAEMON_OPTS \
|| return 2
}
# Function that stops the daemon/service
do_stop()
{
# Return
# 0 if daemon has been stopped
# 1 if daemon was already stopped
# 2 if daemon could not be stopped
# other if a failure occurred
start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME
RETVAL="$?"
[ "$RETVAL" = 2 ] && return 2
start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON
[ "$?" = 2 ] && return 2
rm -f $PIDFILE
return "$RETVAL"
}
# Function that sends a SIGHUP to the daemon/service
#do_reload() {
# start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME
# return 0
#}
case "$1" in
start)
[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC " "$NAME"
do_start
case "$?" in
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
esac
;;
stop)
[ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
do_stop
case "$?" in
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
esac
;;
status)
status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
;;
#reload|force-reload)
#log_daemon_msg "Reloading $DESC" "$NAME"
#do_reload
#log_end_msg $?
#;;
restart|force-reload)
# If the "reload" option is implemented then remove the
# 'force-reload' alias
log_daemon_msg "Restarting $DESC" "$NAME"
do_stop
case "$?" in
0|1)
do_start
case "$?" in
0) log_end_msg 0 ;;
1) log_end_msg 1 ;; # Old process is still running
*) log_end_msg 1 ;; # Failed to start
esac
;;
*)
# Failed to stop
log_end_msg 1
;;
esac
;;
*)
echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2
exit 3
;;
esac
:

25
debian/patches/rename-binary.patch vendored

@ -0,0 +1,25 @@
diff --git a/Makefile b/Makefile
index 9b9425b..84de72f 100644
--- a/Makefile
+++ b/Makefile
@@ -8,9 +8,9 @@ else
include Makefile.linux
endif
-all: obj i2p
+all: obj i2pd
-i2p: $(OBJECTS:obj/%=obj/%)
+i2pd: $(OBJECTS:obj/%=obj/%)
$(CC) -o $@ $^ $(LDFLAGS) $(LIBS)
.SUFFIXES:
@@ -23,7 +23,7 @@ obj:
mkdir -p obj
clean:
- rm -fr obj i2p
+ rm -fr obj i2pd
.PHONY: all
.PHONY: clean

1
debian/patches/series vendored

@ -0,0 +1 @@
rename-binary.patch

14
debian/rules vendored

@ -0,0 +1,14 @@
#!/usr/bin/make -f
# -*- makefile -*-
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk
CFLAGS+=$(CPPFLAGS)
CXXFLAGS+=$(CPPFLAGS)
PREFIX=/usr
%:
dh $@

1
debian/source/format vendored

@ -0,0 +1 @@
3.0 (quilt)

3
debian/watch vendored

@ -0,0 +1,3 @@
version=3
opts=filenamemangle=s/.+\/v?(\d\S*)\.tar\.gz/i2pd-$1\.tar\.gz/ \
https://github.com/PrivacySolutions/i2pd/tags .*/v?(\d\S*)\.tar\.gz
Loading…
Cancel
Save