Skip to content

Commit

Permalink
LaunchDaemon plist, postinst and prerm scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
Filipe Pina committed Jan 20, 2012
1 parent 43644f5 commit 235de78
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 3 deletions.
9 changes: 7 additions & 2 deletions create_deb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,15 @@ export TEMP_DIR="$PWD/deb"
export DEBFILE="transmission-${TRANSMISSION_VERSION}-${ARCH}.deb"

rm -fr ${TEMP_DIR}
mkdir -p ${TEMP_DIR}

mkdir -p ${TEMP_DIR}/DEBIAN
cp control ${TEMP_DIR}/DEBIAN
cp deblayout/control deblayout/postinst deblayout/prerm ${TEMP_DIR}/DEBIAN
echo "Version: ${TRANSMISSION_VERSION}" >> ${TEMP_DIR}/DEBIAN/control
chmod 755 ${TEMP_DIR}/DEBIAN/postinst ${TEMP_DIR}/DEBIAN/prerm

mkdir -p ${TEMP_DIR}/Library/LaunchDaemons
cp deblayout/cc.fopina.transmission.plist ${TEMP_DIR}/Library/LaunchDaemons

cp -Rp ${BUILD_DIR} ${TEMP_DIR}/usr

dpkg-deb -b ${TEMP_DIR} ${DEBFILE}
16 changes: 16 additions & 0 deletions deblayout/cc.fopina.transmission.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>cc.fopina.transmission</string>
<key>ProgramArguments</key>
<array>
<string>/usr/bin/transmission-daemon</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>UserName</key>
<string>mobile</string>
</dict>
</plist>
2 changes: 1 addition & 1 deletion control → deblayout/control
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Package: transmission
Package: cc.fopina.transmission
Section: network
Priority: optional
Architecture: iphoneos-arm
Expand Down
4 changes: 4 additions & 0 deletions deblayout/postinst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

chown root:wheel /Library/LaunchDaemons/cc.fopina.transmission.plist
launchctl load /Library/LaunchDaemons/cc.fopina.transmission.plist
3 changes: 3 additions & 0 deletions deblayout/prerm
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

launchctl unload /Library/LaunchDaemons/cc.fopina.transmission.plist

0 comments on commit 235de78

Please sign in to comment.