Skip to content

Commit

Permalink
Release v1.0.1, fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolaiSoeborg committed May 3, 2019
1 parent ae6728d commit f84b6a1
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 9 deletions.
22 changes: 20 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,23 @@ elf2deb.pyz:
python3 -m zipapp elf2deb --python="/usr/bin/env python3"

.PHONY: test
test: elf2deb.pyz
./elf2deb.pyz --package_name elf2deb --package_version `./elf2deb.pyz --version | awk '{print $NF}'` --license_file LICENSE ./elf2deb.pyz
test: clean elf2deb.pyz
./elf2deb.pyz --package_name elf2deb --package_version `./elf2deb.pyz --version | cut -d' ' -f2` --license_file LICENSE --homepage 'https://xn--sb-lka.org/' --dependencies 'python3' ./elf2deb.pyz
cd elf2deb-`./elf2deb.pyz --version | cut -d' ' -f2` && debuild -us -uc
@echo -n "\nDone building. Now testing output deb file:\n"
dpkg-deb --info elf2deb_*.deb

.PHONY: test2
test2: clean elf2deb.pyz
curl -Lo ./skaffold https://storage.googleapis.com/skaffold/releases/latest/skaffold-linux-amd64
./elf2deb.pyz --license apache-2.0 --license_year 2018 --license_holder "The Skaffold Authors" --package_name skaffold --package_version 0.28.0 --homepage "https://skaffold.dev/" ./skaffold
cd skaffold-0.28.0 && debuild -us -uc
@echo -n "\nDone building. Now testing output deb file:\n"
dpkg-deb --info skaffold_0.28.0*.deb
rm -f skaffold*

.PHONY: clean
clean:
@rm -f elf2deb.pyz
@rm -rf elf2deb-*.*
@rm -rf elf2deb_*.*
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,9 @@ $ . ~/.bashrc
In this example I'm first downloading the [skaffold](https://skaffold.dev/) binary and packing it as a `.deb` file:

```bash
$ curl -Lo ../skaffold https://storage.googleapis.com/skaffold/releases/latest/skaffold-linux-amd64
$ ./elf2deb.pyz --license apache-2.0 --license_year 2018 --license_holder "The Skaffold Authors" --package_name skaffold --package_version 0.28.0 --homepage "https://skaffold.dev/" ../skaffold
$ curl -Lo ./skaffold https://storage.googleapis.com/skaffold/releases/latest/skaffold-linux-amd64
$ ./elf2deb.pyz --license apache-2.0 --license_year 2018 --license_holder "The Skaffold Authors" --package_name skaffold --package_version 0.28.0 --homepage "https://skaffold.dev/" ./skaffold
$ cd skaffold-0.28.0
$ dch --create --empty --distribution unstable --package skaffold --newversion 0.28.0
$ dch --append 'Empty changelog' 2>/dev/null
$ vim debian/control # add description
$ debuild -us -uc
[... lots of debuild output ...]
Expand Down
9 changes: 7 additions & 2 deletions elf2deb/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from pathlib import Path
from zipfile import ZipFile

__version__ = "1.0.0"
__version__ = "1.0.1"
TEMPLATE_DIR = "templates/"


Expand Down Expand Up @@ -112,6 +112,11 @@ def main():
elif args.license_file is not None:
copyright_file = package_dir / 'debian/copyright'
copyright_file.write_text(args.license_file.read())

# Make debian/rules executable:
mode = os.stat(str(package_dir / 'debian/rules')).st_mode
mode |= (mode & 0o444) >> 2 # copy R bits to X
os.chmod(str(package_dir / 'debian/rules'), mode)
print("done!")

print("Copying files... ", end="", flush=True)
Expand All @@ -124,7 +129,7 @@ def main():
print("done!")

run(['dch', '--create', '--empty', '--distribution', 'unstable', '--package', args.package_name, '--newversion', args.package_version], cwd=str(package_dir))
run(['dch', '--append', 'Empty changelog'], stderr=DEVNULL, cwd=str(package_dir))
run(['dch', '--append', 'Packaged using ELF2deb v{}'.format(__version__)], stderr=DEVNULL, cwd=str(package_dir))

print("Run:")
print(" * cd {}".format(package_dir))
Expand Down
2 changes: 1 addition & 1 deletion elf2deb/templates/debian/control
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Source: {package_name}
Section: misc
Priority: extra
Priority: optional
Maintainer: {author_name} <{author_mail}>
Build-Depends: debhelper (>=9)
Standards-Version: 3.9.7
Expand Down
Empty file modified elf2deb/templates/debian/rules
100644 → 100755
Empty file.

0 comments on commit f84b6a1

Please sign in to comment.