From f384477700761c7fde3c2b00644e7d4fd041623a Mon Sep 17 00:00:00 2001 From: idk Date: Sun, 4 Jul 2021 00:37:38 -0400 Subject: [PATCH] Lay out the basics of a Debian or Ubuntu package --- .gitignore | 6 ++ Makefile | 21 +++-- README.md | 102 +++++++++++++++++++++ debian/control | 6 +- debian/install | 10 +- debian/rules | 6 ++ src/unix/desktop/i2pbrowser-debian.desktop | 9 ++ src/unix/desktop/i2pconfig-debian.desktop | 9 ++ 8 files changed, 152 insertions(+), 17 deletions(-) create mode 100644 src/unix/desktop/i2pbrowser-debian.desktop create mode 100644 src/unix/desktop/i2pconfig-debian.desktop diff --git a/.gitignore b/.gitignore index 51a782e..3cb4d23 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,9 @@ build ./I2P/ debian/*.ex debian/*.EX +debian/i2p-firefox-profile +*.crl +*.crt +*.pem +*.info +*.keys.dat \ No newline at end of file diff --git a/Makefile b/Makefile index c26f1f7..c796d5a 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,6 @@ + +PROFILE_VERSION=0.04 + all: install.exe prep: profile.tgz app-profile.tgz profile build/licenses build/I2P build/I2P/config @@ -143,15 +146,11 @@ build/app-profile: build mkdir -p build/app-profile install: - rm -rfv /etc/i2pbrowser \ - /var/lib/i2pbrowser - mkdir -p /etc/i2pbrowser \ - /var/lib/i2pbrowser - install -m644 src/unix/i2pbrowserrc /etc/i2pbrowser/i2pbrowserrc - install -m644 src/unix/i2pbrowserdebianrc /etc/i2pbrowser/i2pbrowserdebianrc - install -m755 build/profile/i2pbrowser.sh /usr/local/bin/i2pbrowser - install -m755 build/app-profile/i2pconfig.sh /usr/local/bin/i2pconfig - install -m755 src/unix/i2p-config-service-setup.sh /usr/local/bin/i2p-config-service-setup + install -D -m644 src/unix/i2pbrowserrc /etc/i2pbrowser/i2pbrowserrc + install -D -m644 src/unix/i2pbrowserdebianrc /etc/i2pbrowser/i2pbrowserdebianrc + install -D -m755 build/profile/i2pbrowser.sh /usr/local/bin/i2pbrowser + install -D -m755 build/app-profile/i2pconfig.sh /usr/local/bin/i2pconfig + install -D -m755 src/unix/i2p-config-service-setup.sh /usr/local/bin/i2p-config-service-setup cp -vr build/profile /var/lib/i2pbrowser/profile cp -vr build/app-profile /var/lib/i2pbrowser/app-profile cp -vr src/icons /var/lib/i2pbrowser/icons @@ -185,3 +184,7 @@ checkinstall: --deldoc=yes \ --deldesc=yes \ --backup=no + +orig: + rm -fv ../i2p-firefox-profile_$(PROFILE_VERSION).orig.tar.gz + tar cvzf ../i2p-firefox-profile_$(PROFILE_VERSION).orig.tar.gz . diff --git a/README.md b/README.md index a3ed344..246278e 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,7 @@ To build this, you will need the following software packages (all available in D * nsis * dos2unix * curl + * jq to build a Debian package, you'll also need @@ -89,6 +90,107 @@ with `sudo service i2p start` then you can run the script: /usr/local/bin/i2p-config-service-setup +Including a jpackaged I2P Router(EXPERIMENTAL) +---------------------------------------------- + +In order to include a jpackaged(dependency-free) I2P router in the Profile +Bundle you will need to build the jpackaged I2P router as an "App Image" on +a Windows system and place it into a directory called `I2P` in your `i2p.firefox` +checkout. + +Assuming a working java and jpackage environment on your Windows system, the +following command should generate a suitable "App Image" in a directory +called "I2P." + + export I2P_VERSION=0.9.49 + cp -R ../i2p.i2p/pkg-temp/lib build/lib + jpackage --type app-image --name I2P --app-version "$I2P_VERSION" \ + --verbose \ + --resource-dir build/lib \ + --input build/lib --main-jar router.jar --main-class net.i2p.router.RouterLaunch + +Transfer the I2P directory to the machine where you build i2p.firefox if +necessary, then complete the regular build instructions. If a jpackaged I2P router +isn't present to use at build time, the inclusion will be skipped automatically +with a non-fatal warning. + +In the near future, I'll start providing a pre-built app image to ease the +build process for non-Windows users. + +End-to-End Windows build process using WSL +------------------------------------------ + +**If you've already done this once, you can just use:** `./build.sh && wsl make` +**in `git bash`** to automatically build an installer. + +**Prerequisites:** You need to have OpenJDK 14 or greater installed and configured +with your `%JAVA_HOME%` environment variable configured and `%JAVA_HOME%/bin` on +your `%PATH%`. You need to have Apache Ant installed and configured with `%ANT_HOME%` +environment variable configured and `%ANT_HOME%/bin` on your `%PATH%`. You must have +Cygwin installed. You must have `NSIS.exe` installed and available on your `%PATH%`. +You must have Git for Windows installed. When installing git for Windows, you should +select "Checkout as is, commit as is" and leave line-endings alone. + + 1. [Set up Windows Subsystem for Linux per Microsoft's instructions](https://docs.microsoft.com/en-us/windows/wsl/install-win10#manual-installation-steps) + 2. [Install Ubuntu Focal per Microsoft's instructions](https://www.microsoft.com/store/apps/9n6svws3rx71) + 3. Open Git Bash. + 4. Install prerequisites `wsl sudo apt-get update && sudo apt-get install make nsis dos2unix curl jq` + 5. Clone `i2p.i2p` and `i2p.firefox` + + git clone https://github.com/i2p/i2p.i2p + git clone https://github.com/i2p/i2p.firefox + + 6. Move to the i2p.i2p directory. Build the .jar files required to build the App Image + inside i2p.i2p. Return to home. + + cd i2p.i2p + ant clean pkg + cd .. + + 7. Move into the i2p.firefox directory. Run the `./build.sh` script. + + cd i2p.firefox + ./build.sh + + 8. Compile the NSIS installer using WSL. + + wsl make + +End-to-End Windows build process using Cygwin +--------------------------------------------- + +**Prerequisites:** You need to have OpenJDK 14 or greater installed and configured +with your `%JAVA_HOME%` environment variable configured and `%JAVA_HOME%/bin` on +your `%PATH%`. You need to have Apache Ant installed and configured with `%ANT_HOME%` +environment variable configured and `%ANT_HOME%/bin` on your `%PATH%`. You must have +Cygwin installed. You must have `NSIS.exe` installed and available on your `%PATH%`. +You must have Git for Windows installed. When installing git for Windows, you should +select "Checkout as is, commit as is" and leave line-endings alone. + +TODO: Add links to the respective instructions for each of these. + + 1. Run the Cygwin `setup-$arch.exe` for your platform to set up new packages. + Select the `make` `jq` `dos2unix` and `curl` packages. + 2. Open a cygwin terminal. + 3. Clone `i2p.i2p` and `i2p.firefox` + + git clone https://github.com/i2p/i2p.i2p + git clone https://github.com/i2p/i2p.firefox + + 3. Move to the i2p.i2p directory. Build the .jar files required to build the App Image + inside i2p.i2p. Return to home. + + cd i2p.i2p + ant clean pkg + cd .. + + 7. Move into the i2p.firefox directory. Run the `./build.sh` script. + + cd i2p.firefox + ./build.sh + + 5. Run `make` to build the installer. + Issues ------ diff --git a/debian/control b/debian/control index e3d76a3..f88af72 100644 --- a/debian/control +++ b/debian/control @@ -1,5 +1,5 @@ Source: i2p-firefox-profile -Section: network +Section: net Priority: optional Maintainer: idk Build-Depends: debhelper-compat (= 13) @@ -11,8 +11,8 @@ Rules-Requires-Root: no Package: i2p-firefox-profile Architecture: all -Depends: firefox,wget,i2p,i2p-router,${misc:Depends} -Suggest: i2p,i2p-router,syndie,tor,tsocks +Depends: firefox,wget,${misc:Depends} +Suggests: i2p,i2p-router,syndie,tor,tsocks Description: A browser profile for Firefox+I2P and script to launch it A Debian/Ubuntu port of the I2P Browser Profile for Firefox/Windows systems. It is built from the same source and has identical diff --git a/debian/install b/debian/install index d08628c..7d6447c 100644 --- a/debian/install +++ b/debian/install @@ -1,10 +1,10 @@ src/unix/i2pbrowserrc /etc/i2pbrowser/i2pbrowserrc src/unix/i2pbrowserdebianrc /etc/i2pbrowser/i2pbrowserdebianrc -src/unix/i2pbrowser.sh /usr/local/bin/i2pbrowser -src/unix/i2pconfig.sh /usr/local/bin/i2pconfig -src/unix/i2p-config-service-setup.sh /usr/local/bin/i2p-config-service-setup +src/unix/i2pbrowser.sh /usr/bin/ +src/unix/i2pconfig.sh /usr/bin/ +src/unix/i2p-config-service-setup.sh /usr/bin/ src/profile /var/lib/i2pbrowser/profile src/app-profile /var/lib/i2pbrowser/app-profile src/icons /var/lib/i2pbrowser/icons -src/unix/desktop/i2pbrowser.desktop /usr/share/applications -src/unix/desktop/i2pconfig.desktop /usr/share/applications \ No newline at end of file +src/unix/desktop/i2pbrowser-debian.desktop /usr/share/applications/i2pbrowser.desktop +src/unix/desktop/i2pconfig-debian.desktop /usr/share/applications/i2pconfig.desktop diff --git a/debian/rules b/debian/rules index 59ea751..782bfd8 100755 --- a/debian/rules +++ b/debian/rules @@ -23,3 +23,9 @@ #override_dh_auto_configure: # dh_auto_configure -- \ # -DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH) + +override_dh_auto_build: + @echo "no need to do the windows build" + +override_dh_auto_install: + @echo "use debian/install" diff --git a/src/unix/desktop/i2pbrowser-debian.desktop b/src/unix/desktop/i2pbrowser-debian.desktop new file mode 100644 index 0000000..23b3eba --- /dev/null +++ b/src/unix/desktop/i2pbrowser-debian.desktop @@ -0,0 +1,9 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Exec=/usr/bin/i2pbrowser.sh +Name=I2P Browser +Categories=Network;WebBrowser; +Icon=/var/lib/i2pbrowser/icons/ui2pbrowser_icon.ico \ No newline at end of file diff --git a/src/unix/desktop/i2pconfig-debian.desktop b/src/unix/desktop/i2pconfig-debian.desktop new file mode 100644 index 0000000..3c9b853 --- /dev/null +++ b/src/unix/desktop/i2pconfig-debian.desktop @@ -0,0 +1,9 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Exec=/usr/bin/i2pconfig.sh +Name=I2P Configuration +Categories=Network;WebBrowser; +Icon=/var/lib/i2pbrowser/icons/ui2pbrowser_icon.ico \ No newline at end of file