Skip to content

Commit

Permalink
Add build scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
Unrud committed Oct 14, 2015
1 parent 083c365 commit 538ad7c
Show file tree
Hide file tree
Showing 26 changed files with 311 additions and 0 deletions.
10 changes: 10 additions & 0 deletions buid.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash
set -e

file="`readlink -m "$0"`"
home="`dirname "$file"`"
cd "$home"

for s in package-*/build.sh; do
"$s"
done
16 changes: 16 additions & 0 deletions package-ubuntu-trusty/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash
set -e

file="`readlink -m "$0"`"
home="`dirname "$file"`"
cd "$home"

package="init-headphone"
version="`grep -o -P -m 1 "\(.*\)" debian/changelog | tr -d "()"`"
temp="`mktemp -d`"
mkdir "$temp/$package-$version"
cp -ar * ../src "$temp/$package-$version"
cd "$temp/$package-$version"
dpkg-buildpackage -us -uc
cd "$home"
cp "$temp"/*.deb ..
60 changes: 60 additions & 0 deletions package-ubuntu-trusty/debian/changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
init-headphone (0.10.0-trusty) stable;

* recognize more i2c bus names

-- Unrud <unrud@openaliasbox.org> Wed, 14 Oct 2015 09:18:29 +0200

init-headphone (0.9.0-trusty) unstable;

* remove model check

-- Unrud <unrud@openaliasbox.org> Sun, 27 Sep 2015 09:18:29 +0200

init-headphone (0.8.0-trusty) unstable;

* use baseboard product name instead of system product name to identify model
* model communication with device after newer versions of the Windows driver
* add lots of supposedly supported models
* add ability to skip model check
* improved help
* improved logging

-- Unrud <unrud@openaliasbox.org> Sat, 11 Jul 2015 22:54:38 +0200

init-headphone (0.6.0-trusty) unstable;

* Add Eurocom M4 to supported systems

-- Unrud <unrud@openaliasbox.org> Mon, 22 Jun 2015 21:08:40 +0200

init-headphone (0.5.0-trusty) unstable;

* Add W230SD to supported systems

-- Unrud <unrud@openaliasbox.org> Tue, 02 Jun 2015 13:59:35 +0200

init-headphone (0.4.0-trusty) unstable;

* Remove dependency on python-smbus

-- Unrud <unrud@openaliasbox.org> Sun, 10 May 2015 08:53:03 +0200

init-headphone (0.3.0-trusty) unstable;

* Add mute/unmute and effects
* Add "Mythlogic Chaos 1313-A" and "HUMA H3" to supported products

-- Unrud <unrud@openaliasbox.org> Sun, 26 April 2015 23:06:12 +0200

init-headphone (0.2.0) unstable;

* Add Upstart script to run program on boot
* Make program more verbose

-- Unrud <unrud@openaliasbox.org> Mon, 30 March 2015 14:31:41 +0200

init-headphone (0.1.0) unstable;

* Initial Release.

-- Unrud <unrud@openaliasbox.org> Sun, 29 March 2015 23:46:21 +0200
8 changes: 8 additions & 0 deletions package-ubuntu-trusty/debian/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Source: init-headphone
Maintainer: Unrud <unrud@openaliasbox.org>

Package: init-headphone
Architecture: all
Priority: optional
Depends: python
Description: Manage the headphone amplifier found in some Clevo laptops
5 changes: 5 additions & 0 deletions package-ubuntu-trusty/debian/init-headphone.install
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
src/init-headphone /usr/sbin/
pm-sleep/* /etc/pm/sleep.d/
grub/* /etc/default/grub.d/
modules-load/* /etc/modules-load.d/
init/* /etc/init/
16 changes: 16 additions & 0 deletions package-ubuntu-trusty/debian/init-headphone.postinst
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/sh

NOTIFIER="/usr/share/update-notifier/notify-reboot-required"

case "${1:-}" in
configure|reconfigure)
if type update-grub; then
update-grub || true
fi
if [ -x "$NOTIFIER" ]; then
"$NOTIFIER" || true
fi
;;

*) :;;
esac
11 changes: 11 additions & 0 deletions package-ubuntu-trusty/debian/init-headphone.postrm
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh

case "${1:-}" in
remove)
if type update-grub; then
update-grub || true
fi
;;

*) :;;
esac
8 changes: 8 additions & 0 deletions package-ubuntu-trusty/debian/rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/make -f
# -*- makefile -*-

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

%:
dh $@
1 change: 1 addition & 0 deletions package-ubuntu-trusty/grub/init-headphone.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
GRUB_CMDLINE_LINUX_DEFAULT="$GRUB_CMDLINE_LINUX_DEFAULT acpi_enforce_resources=lax"
3 changes: 3 additions & 0 deletions package-ubuntu-trusty/init/init-headphone.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
description "Enable headphone jack on Clevo W230SS"
start on runlevel [2345]
exec /usr/sbin/init-headphone
2 changes: 2 additions & 0 deletions package-ubuntu-trusty/modules-load/init-headphone.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
i2c-i801
i2c-dev
11 changes: 11 additions & 0 deletions package-ubuntu-trusty/pm-sleep/init-headphone
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh

if [ ! -x /usr/sbin/init-headphone ]; then
exit 0
fi

case $1 in
resume|thaw)
/usr/sbin/init-headphone
;;
esac
16 changes: 16 additions & 0 deletions package-ubuntu-vivid/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash
set -e

file="`readlink -m "$0"`"
home="`dirname "$file"`"
cd "$home"

package="init-headphone"
version="`grep -o -P -m 1 "\(.*\)" debian/changelog | tr -d "()"`"
temp="`mktemp -d`"
mkdir "$temp/$package-$version"
cp -ar * ../src "$temp/$package-$version"
cd "$temp/$package-$version"
dpkg-buildpackage -us -uc
cd "$home"
cp "$temp"/*.deb ..
61 changes: 61 additions & 0 deletions package-ubuntu-vivid/debian/changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
init-headphone (0.10.0-vivid) stable;

* recognize more i2c bus names

-- Unrud <unrud@openaliasbox.org> Wed, 14 Oct 2015 09:18:29 +0200

init-headphone (0.9.0-vivid) unstable;

* remove model check

-- Unrud <unrud@openaliasbox.org> Sun, 27 Sep 2015 09:18:29 +0200

init-headphone (0.8.0-vivid) unstable;

* use baseboard product name instead of system product name to identify model
* model communication with device after newer versions of the Windows driver
* add lots of supposedly supported models
* add ability to skip model check
* improved help
* improved logging

-- Unrud <unrud@openaliasbox.org> Sat, 11 Jul 2015 22:54:38 +0200

init-headphone (0.6.0-vivid) unstable;

* Add Eurocom M4 to supported systems

-- Unrud <unrud@openaliasbox.org> Mon, 22 Jun 2015 21:08:40 +0200

init-headphone (0.5.0-vivid) unstable;

* Add W230SD to supported systems

-- Unrud <unrud@openaliasbox.org> Tue, 02 Jun 2015 13:59:35 +0200

init-headphone (0.4.0-vivid) unstable;

* Remove dependency on python-smbus

-- Unrud <unrud@openaliasbox.org> Sun, 10 May 2015 08:53:03 +0200

init-headphone (0.3.0-vivid) unstable;

* Add mute/unmute and effects
* Use systemd instead of Upstart
* Add "Mythlogic Chaos 1313-A" and "HUMA H3" to supported products

-- Unrud <unrud@openaliasbox.org> Sun, 26 April 2015 23:06:12 +0200

init-headphone (0.2.0) unstable;

* Add Upstart script to run program on boot
* Make program more verbose

-- Unrud <unrud@openaliasbox.org> Mon, 30 March 2015 14:31:41 +0200

init-headphone (0.1.0) unstable;

* Initial Release.

-- Unrud <unrud@openaliasbox.org> Sun, 29 March 2015 23:46:21 +0200
8 changes: 8 additions & 0 deletions package-ubuntu-vivid/debian/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Source: init-headphone
Maintainer: Unrud <unrud@openaliasbox.org>

Package: init-headphone
Architecture: all
Priority: optional
Depends: python
Description: Manage the headphone amplifier found in some Clevo laptops
5 changes: 5 additions & 0 deletions package-ubuntu-vivid/debian/init-headphone.install
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
src/init-headphone /usr/sbin/
grub/* /etc/default/grub.d/
modules-load/* /etc/modules-load.d/
systemd/* /lib/systemd/system/
systemd-links/* /etc/systemd/system/
22 changes: 22 additions & 0 deletions package-ubuntu-vivid/debian/init-headphone.postinst
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/sh

NOTIFIER="/usr/share/update-notifier/notify-reboot-required"
MODULES_BLACKLIST="/etc/modprobe.d/blacklist.conf"

case "${1:-}" in
configure|reconfigure)
if type update-grub; then
update-grub || true
fi
if [ -x "$NOTIFIER" ]; then
"$NOTIFIER" || true
fi

if [ -f "$MODULES_BLACKLIST" ]; then
t="$(sed "s/^blacklist i2c_i801$/#\0 # Commented out by init-headphone/" "$MODULES_BLACKLIST")"
echo -n "$t" >"$MODULES_BLACKLIST"
fi
;;

*) :;;
esac
18 changes: 18 additions & 0 deletions package-ubuntu-vivid/debian/init-headphone.postrm
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/sh

MODULES_BLACKLIST="/etc/modprobe.d/blacklist.conf"

case "${1:-}" in
remove)
if type update-grub; then
update-grub || true
fi

if [ -f "$MODULES_BLACKLIST" ]; then
t="$(sed "s/^#blacklist i2c_i801 # Commented out by init-headphone$/blacklist i2c_i801/" "$MODULES_BLACKLIST")"
echo -n "$t" >"$MODULES_BLACKLIST"
fi
;;

*) :;;
esac
8 changes: 8 additions & 0 deletions package-ubuntu-vivid/debian/rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/make -f
# -*- makefile -*-

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

%:
dh $@
1 change: 1 addition & 0 deletions package-ubuntu-vivid/grub/init-headphone.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
GRUB_CMDLINE_LINUX_DEFAULT="$GRUB_CMDLINE_LINUX_DEFAULT acpi_enforce_resources=lax"
2 changes: 2 additions & 0 deletions package-ubuntu-vivid/modules-load/init-headphone.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
i2c-i801
i2c-dev
15 changes: 15 additions & 0 deletions package-ubuntu-vivid/systemd/init-headphone.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[Unit]
Description=Enable headphone jack on Clevo W230SS after suspend
After=suspend.target
After=hibernate.target
After=hybrid-sleep.target

[Service]
Type=oneshot
ExecStart=/usr/sbin/init-headphone

[Install]
WantedBy=suspend.target
WantedBy=hibernate.target
WantedBy=hybrid-sleep.target
WantedBy=multi-user.target

0 comments on commit 538ad7c

Please sign in to comment.