offline-twitter/build/build_dpkg.sh

53 lines
1.2 KiB
Bash
Raw Normal View History

2021-11-29 14:18:20 -08:00
#!/bin/bash
set -e
if [[ -z "$1" ]]
then
# Error message and exit
>&2 echo "No version number provided! Exiting."
exit 1
fi
version=$1
(cd ../cmd && ./compile.sh --static $version)
2021-11-29 14:18:20 -08:00
# Prepare the output folder
if [[ -e dpkg_tmp ]]
then
rm -rf dpkg_tmp
fi
mkdir dpkg_tmp
# Construct the dpkg directory structure
mkdir -p dpkg_tmp/usr/local/bin
2021-11-29 15:23:16 -08:00
cp ../cmd/tw dpkg_tmp/usr/local/bin/twitter
2021-11-29 14:18:20 -08:00
2024-02-23 19:01:36 -08:00
# Create the Desktop files
mkdir -p dpkg_tmp/usr/share/pixmaps
cp twitter.png dpkg_tmp/usr/share/pixmaps
mkdir -p dpkg_tmp/usr/share/applications
cp Twitter.desktop dpkg_tmp/usr/share/applications/Twitter.desktop
2021-11-29 14:18:20 -08:00
# Create the `DEBIAN/control` file
mkdir dpkg_tmp/DEBIAN
2024-02-23 19:01:36 -08:00
echo "Package: offline-twitter
Version: $version
2021-11-29 14:18:20 -08:00
Architecture: all
2023-03-09 22:55:02 -05:00
Maintainer: alex@playfulpachyderm.com
2023-06-07 15:44:25 -03:00
Installed-Size: `du -k dpkg_tmp | tail -n 1 | cut -f 1`
2021-11-29 14:18:20 -08:00
Depends:
Section: web
Priority: optional
Homepage: http://offline-twitter.com
Description: This utility is the scraper engine that drives \`offline-twitter\`.
Download and browse content from twitter. Everything you browse gets saved as
a local copy into a SQLite database on your computer.
2021-11-29 14:18:20 -08:00
" > dpkg_tmp/DEBIAN/control
dpkg-deb --build `pwd`/dpkg_tmp .