19 Commits

Author SHA1 Message Date
idk
8285bc24a6 Resolve packaging issues, document the release process somewhat 2020-04-19 02:37:43 -04:00
idk
7c49522c9f Resolve packaging issues, document the release process somewhat 2020-04-19 02:37:25 -04:00
idk
c524eee992 Resolve packaging issues, document the release process somewhat 2020-04-19 02:05:01 -04:00
idk
cdf4116c56 fix the build bug 2020-02-19 22:15:12 -05:00
idk
9b51d06b6c update packaging 2019-12-08 19:34:13 -05:00
idk
d0e0557c65 make it native 2019-03-16 14:11:27 -04:00
idk
d02a695843 update changelog 2019-03-16 14:05:11 -04:00
idk
b779b0f58c fix wrong substitution 2019-03-16 14:01:40 -04:00
idk
bbbdddf4b3 update README 2019-03-14 20:14:18 -04:00
lair repo key
6c28b380bd mark as proposed so the PPA will let it in 2019-02-28 16:57:51 -05:00
lair repo key
943176157c add symlink to post-install script 2019-02-28 16:32:01 -05:00
lair repo key
11b01f33c4 add missing debian/ files 2019-02-28 16:18:58 -05:00
lair repo key
6ee4c38e29 update package 2019-02-28 16:10:24 -05:00
lair repo key
ba817460d6 update package 2019-02-28 16:09:51 -05:00
lair repo key
d053383208 update package 2019-02-28 16:08:52 -05:00
lair repo key
a38f1db2dd update package 2019-02-28 16:07:18 -05:00
lair repo key
24a946f3e7 set the http_proxy(lowercase) environment variable too 2019-02-25 20:51:48 -05:00
lair repo key
2a1ca1d3aa intialize debian packaging 2019-02-23 21:22:56 -05:00
lair repo key
3f92178574 Ignore quilt dir .pc via .gitignore 2019-02-23 21:21:31 -05:00
14 changed files with 257 additions and 5 deletions

5
.gitignore vendored Normal file
View File

@@ -0,0 +1,5 @@
.pc
README.md.asc
apt-transport-i2phttp
deb

View File

@@ -1,12 +1,38 @@
PKG=`basename $(PWD)`
VERSION=$(shell head -n 1 debian/changelog | sed "s|$(PKG) (||g" | sed 's|).*||')
echo:
@echo "$(VERSION)"
apt-transport-i2phttp: apt-transport-i2phttp:
go build \ go build \
-a \ -a \
-tags netgo \ -tags netgo \
-ldflags '-w -extldflags "-static"' -ldflags '-w -extldflags "-static"'
install: apt-transport-i2phttp install:
install -m755 apt-transport-i2phttp /usr/lib/apt/methods/i2p install -m755 apt-transport-i2phttp /usr/lib/apt/methods/i2p
clean: clean:
go clean go clean
orig:
tar --exclude=.git --exclude=debian -czvf ../apt-transport-i2phttp_$(VERSION).orig.tar.gz .
release: ubuntu debian
debian:
./release.sh stable
./release.sh testing
./release.sh unstable
ubuntu:
./release.sh bionic
./release.sh eoan
./release.sh focal
github-release: release
./release.sh upload

View File

@@ -26,10 +26,43 @@ by default. You can just:
to install ./apt-transport-i2phttp to /usr/lib/apt/methods/i2p, requiring no to install ./apt-transport-i2phttp to /usr/lib/apt/methods/i2p, requiring no
additional configuration. additional configuration.
To build a proper deb of it:
----------------------------
Building a release is done with pbuilder to avoid building a release with
packages not in the appropriate version of Debian or Ubuntu. Use
```pbuilder create``` to set up the chroot appropriate to your target
distribution. Then, in the root of the repository directory, run the command
```debuild -s``` to generate a .dsc file in the parent directory. Now that you
have the ,dsc file, create a build directory using ```mkdir -p deb/targetdistro```
and run ```pbuilder build --buildresult ./deb/stable``` to generate your actual
deb packages. Of course, you'll have to adjust the commands to suit the target
distribution. And you have to do it for every single distribution you want to
build for.
I have [this script stored at this gist](https://gist.github.com/eyedeekay/91927f31396dd50ae9d22051ded154ef)
that I use to make my life easier. It should also be pretty easy to understand.
From the repository directory, run the script like:
$pathtoscript/release.sh stable
so to build for like a whole bunch of releases(With it installed as release-pdeb
in /usr/local/bin):
release-pdeb stable
release-pdeb testing
release-pdeb unstable
release-pdeb bionic
release-pdeb eoan
release-pdeb focal
To use it: To use it:
--------- ---------
To add an eepSite to your sources.list, for example(This example site is down, Adding this to your sources.list.d will configure apt to seek updates to
I'll have a new one for you to use shortly): ppa.launchpad.net/i2p-maintainers from a caching proxy at the b32 address:
```h2knzawve56vtiimbdsl74bmbuw7xr65xhgrdjtjnbfxxw4hsqlq.b32.i2p```
deb i2p://http://wnhxwrq4fkn3cov6bnqsdaniubeo3625rmsm53yaz336bxvtiqeq.b32.i2p/deb-pkg rolling main deb i2p://h2knzawve56vtiimbdsl74bmbuw7xr65xhgrdjtjnbfxxw4hsqlq.b32.i2p/ppa.launchpad.net/i2p-maintainers/i2p/ubuntu bionic main
deb-src i2p://h2knzawve56vtiimbdsl74bmbuw7xr65xhgrdjtjnbfxxw4hsqlq.b32.i2p/ppa.launchpad.net/i2p-maintainers/i2p/ubuntu bionic main

31
debian/changelog vendored Normal file
View File

@@ -0,0 +1,31 @@
apt-transport-i2phttp (0.3) bionic; urgency=medium
[ idk ]
* Downgrade minimum recommended debhelper to 10
-- idk <hankhill19580@gmail.com> Sat, 16 Apr 2020 19:20:21 -0500
apt-transport-i2phttp (0.2) bionic; urgency=medium
[ idk ]
* Update the packaging
-- idk <hankhill19580@gmail.com> Sun, 08 Dec 2019 19:35:21 -0500
apt-transport-i2phttp (0.1) bionic; urgency=medium
[ idk ]
* fix wrong substitution for proxy, stabilize
-- idk <hankhill19580@gmail.com> Sat, 16 Mar 2019 14:04:22 -0500
apt-transport-i2phttp (0.0~git20190224.6dc102d-1) proposed; urgency=medium
[ idk ]
* Initial release (Closes: TODO)
[ idk ]
* set the http_proxy(lowercase) environment variable too
-- idk <hankhill19580@gmail.com> Thu, 28 Feb 2019 15:45:39 -0500

1
debian/compat vendored Normal file
View File

@@ -0,0 +1 @@
11

27
debian/control vendored Normal file
View File

@@ -0,0 +1,27 @@
Source: apt-transport-i2phttp
Section: devel
Priority: optional
Maintainer: idk <hankhill19580@gmail.com>
Uploaders: idk <hankhill19580@gmail.com>
Build-Depends: debhelper (>= 10),
dh-golang,
golang-go
Standards-Version: 4.2.1
Homepage: https://github.com/eyedeekay/apt-transport-i2phttp
Vcs-Browser: https://github.com/eyedeekay/apt-transport-i2phttp
Vcs-Git: https://github.com/eyedeekay/apt-transport-i2phttp.git
XS-Go-Import-Path: github.com/eyedeekay/apt-transport-i2phttp
Testsuite: autopkgtest-pkg-go
Package: apt-transport-i2phttp
Architecture: any
Built-Using: ${misc:Built-Using}
Depends: ${misc:Depends},
${shlibs:Depends}
Description: An apt transport for i2p using the built-in HTTP proxy
apt-transport-i2phttp, HTTP-based I2P Transport for apt This
is a simple transport for downloading debian packages from a
repository over i2p. It uses the built-in HTTP proxy or one you
configure. It's a modified version of diocles/apt-tranport-http-golang
(https://github.com/diocles/apt-transport-http-golang), a plain HTTP
Transport for apt.

17
debian/copyright vendored Normal file
View File

@@ -0,0 +1,17 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: apt-transport-i2phttp
Source: https://github.com/eyedeekay/apt-transport-i2phttp
Files-Excluded:
Godeps/_workspace
Files: *
Copyright: 2019 idk
License: TODO
Files: debian/*
Copyright: 2019 idk <hankhill19580@gmail.com>
License: TODO
Comment: Debian packaging is licensed under the same terms as upstream
License: TODO
TODO

2
debian/gbp.conf vendored Normal file
View File

@@ -0,0 +1,2 @@
[DEFAULT]
pristine-tar = True

1
debian/postinstall vendored Normal file
View File

@@ -0,0 +1 @@
ln -sf /usr/bin/apt-transport-i2phttp /usr/lib/apt/methods/i2p

10
debian/rules vendored Executable file
View File

@@ -0,0 +1,10 @@
#!/usr/bin/make -f
override_dh_auto_install:
dh_auto_install -- --no-source
mkdir -p debian/apt-transport-i2phttp/usr/lib/apt/methods/
ln -sf debian/apt-transport-i2phttp/usr/bin/apt-transport-i2phttp \
debian/apt-transport-i2phttp/usr/lib/apt/methods/i2p
%:
dh $@ --buildsystem=golang --with=golang

1
debian/source/format vendored Normal file
View File

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

4
debian/watch vendored Normal file
View File

@@ -0,0 +1,4 @@
version=4
opts=filenamemangle=s/.+\/v?(\d\S*)\.tar\.gz/apt-transport-i2phttp-\$1\.tar\.gz/,\
uversionmangle=s/(\d)[_\.\-\+]?(RC|rc|pre|dev|beta|alpha)[.]?(\d*)$/\$1~\$2\$3/ \
https://github.com/eyedeekay/apt-transport-i2phttp/tags .*/v?(\d\S*)\.tar\.gz

View File

@@ -58,6 +58,7 @@ func ReadInConfig() {
if _, err := os.Stat(os.Getenv("APT_TRANSPORT_I2PHTTP_CONF")); os.IsNotExist(err) { if _, err := os.Stat(os.Getenv("APT_TRANSPORT_I2PHTTP_CONF")); os.IsNotExist(err) {
os.Setenv("I2P_HTTP_PROXY", "http://127.0.0.1:4444") os.Setenv("I2P_HTTP_PROXY", "http://127.0.0.1:4444")
os.Setenv("HTTP_PROXY", "http://127.0.0.1:4444") os.Setenv("HTTP_PROXY", "http://127.0.0.1:4444")
os.Setenv("http_proxy", "http://127.0.0.1:4444")
} else if err != nil { } else if err != nil {
log.Fatal(err) log.Fatal(err)
} else { } else {
@@ -80,12 +81,15 @@ func ReadInConfig() {
} }
os.Setenv("I2P_HTTP_PROXY", "http://"+host+":"+port) os.Setenv("I2P_HTTP_PROXY", "http://"+host+":"+port)
os.Setenv("HTTP_PROXY", "http://"+host+":"+port) os.Setenv("HTTP_PROXY", "http://"+host+":"+port)
os.Setenv("http_proxy", "http://"+host+":"+port)
} }
if os.Getenv("I2P_HTTP_PROXY") == "" { if os.Getenv("I2P_HTTP_PROXY") == "" {
os.Setenv("I2P_HTTP_PROXY", "http://127.0.0.1:4444") os.Setenv("I2P_HTTP_PROXY", "http://127.0.0.1:4444")
os.Setenv("HTTP_PROXY", "http://127.0.0.1:4444") os.Setenv("HTTP_PROXY", "http://127.0.0.1:4444")
os.Setenv("http_proxy", "http://127.0.0.1:4444")
} else { } else {
os.Setenv("HTTP_PROXY", os.Getenv("I2P_HTTP_PROXY")) os.Setenv("HTTP_PROXY", os.Getenv("I2P_HTTP_PROXY"))
os.Setenv("http_proxy", os.Getenv("I2P_HTTP_PROXY"))
} }
} }
@@ -189,7 +193,7 @@ func fetch(c chan<- *Message, m *Message) {
// TODO: Fix bug with appending to existing files // TODO: Fix bug with appending to existing files
// TODO: implement range requests if file already exists // TODO: implement range requests if file already exists
realURI := strings.TrimPrefix(uri, "i2p://") realURI := strings.Replace(uri, "i2p://", "http://", 1)
resp, err := http.Get(realURI) resp, err := http.Get(realURI)
if err != nil { if err != nil {

90
release.sh Executable file
View File

@@ -0,0 +1,90 @@
#! /usr/bin/env sh
PKG=$(basename $(pwd))
VERSION=$(head -n 1 debian/changelog | sed "s|$PKG (||g" | sed 's|).*||')
DEBIANS="stable testing unstable experimental wheezy jessie stretch buster bullseye bookworm sid"
debrepo="--mirror http://us.archive.ubuntu.com/ubuntu"
for debian in $DEBIANS; do
if [ $1 = "$debian" ]; then
echo "$debian detetced"
debrepo=""
fi
done
setup(){
install -m755 ./release.sh /usr/bin/release-pdeb
}
upload(){
cd deb
for bin in $(find . -name '*.deb'); do
dist=$(dirname $bin)
name=$(basename $bin)
gothub upload -R -u eyedeekay -r $PKG -t $VERSION -n $dist-$name -f $bin \;
done
for bin in $(find . -name '*.orig.tar.gz'); do
dist=$(dirname $bin)
name=$(basename $bin)
gothub upload -R -u eyedeekay -r $PKG -t $VERSION -n $dist-$name -f $bin \;
done
for bin in $(find . -name '*.tar.xz'); do
dist=$(dirname $bin)
name=$(basename $bin)
gothub upload -R -u eyedeekay -r $PKG -t $VERSION -n $dist-$name -f $bin \;
done
for bin in $(find . -name '*.dsc'); do
dist=$(dirname $bin)
name=$(basename $bin)
gothub upload -R -u eyedeekay -r $PKG -t $VERSION -n $dist-$name -f $bin \;
done
for bin in $(find . -name '*.changes'); do
dist=$(dirname $bin)
name=$(basename $bin)
gothub upload -R -u eyedeekay -r $PKG -t $VERSION -n $dist-$name -f $bin \;
done
for bin in $(find . -name '*.buildinfo'); do
dist=$(dirname $bin)
name=$(basename $bin)
gothub upload -R -u eyedeekay -r $PKG -t $VERSION -n $dist-$name -f $bin \;
done
cd ..
}
releasebuild() {
if test -f "/var/cache/pbuilder/$1.tgz" ; then
echo "updating chroot for $1 in /var/cache/pbuilder/$1.tgz"
sudo pbuilder update --basetgz "/var/cache/pbuilder/$1.tgz" --distribution "$1" $debrepo
else
echo "creating chroot for $1 in /var/cache/pbuilder/$1.tgz"
sudo pbuilder create --basetgz "/var/cache/pbuilder/$1.tgz" --distribution "$1" $debrepo
fi
echo "building for $1"
echo "generating source"
tar --exclude=.git --exclude=debian --exclude deb -czvf ../$PKG_$VERSION.orig.tar.gz .
debuild -S
echo "making output directory ./deb/$1"
mkdir -p "./deb/$1"
echo "sudo pbuilder --build --buildresult ./deb/$1 $debrepo --distribution $1 ../""$2""_0.3.dsc "
sudo pbuilder --build --basetgz "/var/cache/pbuilder/$1.tgz" --buildresult "./deb/$1" $debrepo --distribution $1 "../""$2""_$3.dsc"
sudo chown -R $(whoami):$(whoami) deb
}
if [ "install" = "$1" ]; then
setup || exit 1
exit 0
fi
if [ "upload" = "$1" ]; then
upload || exit 1
exit 0
fi
if [ ! -z $1 ]; then
releasebuild $1 "$PKG" "$VERSION"
else
releasebuild stable "$PKG" "$VERSION"
fi