Skip to content

Commit

Permalink
chore(packaging): use makefile
Browse files Browse the repository at this point in the history
re #153
  • Loading branch information
actionless committed Aug 3, 2018
1 parent 74ccb4e commit a5b5f3b
Show file tree
Hide file tree
Showing 7 changed files with 71 additions and 65 deletions.
64 changes: 64 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
DESTDIR = ./distrib
PREFIX = /opt/oomox


.PHONY: clean
clean:
$(RM) -r $(DESTDIR)

.PHONY: install
install: clean
$(eval APP_DIR := $(DESTDIR)$(PREFIX))
$(eval PACKAGING_TMP_DIR := $(shell mktemp -d))

mkdir -p $(APP_DIR)
cp -prf \
CREDITS \
LICENSE \
README.md \
colors \
gui.sh \
oomox_gui \
plugins \
po \
po.mk \
terminal_templates \
$(APP_DIR)/

$(RM) -r "$(APP_DIR)/plugins/oomoxify/".git*
$(RM) -r "$(APP_DIR)/plugins"/*/*/.git*
$(RM) -r "$(APP_DIR)/plugins/theme_oomox/gtk-theme/".editorconfig
$(RM) -r "$(APP_DIR)/plugins/theme_oomox/gtk-theme/".*.yml
$(RM) -r "$(APP_DIR)/plugins/theme_oomox/gtk-theme/"{D,d}ocker*
$(RM) -r "$(APP_DIR)/plugins/theme_oomox/gtk-theme/"maintenance*
$(RM) -r "$(APP_DIR)/plugins/theme_oomox/gtk-theme/"screenshot*
$(RM) -r "$(APP_DIR)/plugins/theme_oomox/gtk-theme/"test*

cp -prf \
packaging/ \
$(PACKAGING_TMP_DIR)/
sed -i -e 's|/opt/oomox/|$(PREFIX)/|g' $(PACKAGING_TMP_DIR)/packaging/bin/*

install -Dp -m 755 --target-directory="$(DESTDIR)/usr/bin/" "$(PACKAGING_TMP_DIR)/packaging/bin/"*

install -d $(DESTDIR)/usr/share/applications/
install -Dp -m 644 "$(PACKAGING_TMP_DIR)/packaging/com.github.themix_project.Oomox.desktop" "$(DESTDIR)/usr/share/applications/"

install -d $(DESTDIR)/usr/share/appdata/
install -Dp -m 644 "$(PACKAGING_TMP_DIR)/packaging/com.github.themix_project.Oomox.appdata.xml" "$(DESTDIR)/usr/share/appdata/"

install -Dp -m 644 "$(PACKAGING_TMP_DIR)/packaging/com.github.themix_project.Oomox-symbolic.svg" "$(DESTDIR)/usr/share/icons/hicolor/symbolic/apps/com.github.themix_project.Oomox-symbolic.svg"
install -Dp -m 644 "$(PACKAGING_TMP_DIR)/packaging/com.github.themix_project.Oomox-16.png" "$(DESTDIR)/usr/share/icons/hicolor/16x16/apps/com.github.themix_project.Oomox.png"
install -Dp -m 644 "$(PACKAGING_TMP_DIR)/packaging/com.github.themix_project.Oomox-24.png" "$(DESTDIR)/usr/share/icons/hicolor/24x24/apps/com.github.themix_project.Oomox.png"
install -Dp -m 644 "$(PACKAGING_TMP_DIR)/packaging/com.github.themix_project.Oomox-32.png" "$(DESTDIR)/usr/share/icons/hicolor/32x32/apps/com.github.themix_project.Oomox.png"
install -Dp -m 644 "$(PACKAGING_TMP_DIR)/packaging/com.github.themix_project.Oomox-48.png" "$(DESTDIR)/usr/share/icons/hicolor/48x48/apps/com.github.themix_project.Oomox.png"
install -Dp -m 644 "$(PACKAGING_TMP_DIR)/packaging/com.github.themix_project.Oomox-512.png" "$(DESTDIR)/usr/share/icons/hicolor/512x512/apps/com.github.themix_project.Oomox.png"

$(RM) -r $(PACKAGING_TMP_DIR)

cd $(APP_DIR)
# will update ./po and produce ./locale dir:
make -f po.mk install
rm $(APP_DIR)/po.mk

all: install
2 changes: 1 addition & 1 deletion maintenance_scripts/show_recent_history.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

filter=cat
if [[ "${1:-}" = '-c' ]] ; then
filter="grep -v -i -e style -e travis -e docker -e chore -e test -e revert -e screensh -e merge"
filter="grep -v -i -E -e (typing|typehint|coverage|travis|docker) -e actionless.*(chore|test|style|doc|Revert|Merge)"
shift
fi

Expand Down
2 changes: 1 addition & 1 deletion packaging/arch/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,6 @@ prepare(){

package() {
cd "${srcdir}/oomox"
./packaging/install.sh ./ "${pkgdir}"
make DESTDIR="${pkgdir}" install
python -O -m compileall ${pkgdir}/opt/oomox/oomox_gui
}
3 changes: 2 additions & 1 deletion packaging/flatpak/com.github.themix_project.Oomox.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@
"name": "oomox",
"buildsystem": "simple",
"build-commands": [
"./packaging/flatpak/install.sh"
"make DESTDIR=/ PREFIX=/app/opt/oomox install",
"python3 -O -m compileall /app/opt/oomox/oomox_gui"
],
"sources": [
{
Expand Down
14 changes: 0 additions & 14 deletions packaging/flatpak/install.sh

This file was deleted.

48 changes: 1 addition & 47 deletions packaging/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,57 +2,11 @@
#set -x
set -ueo pipefail

# @TODO: mb rewrite it as a Makefile

srcdir=$(readlink -e "$1")
#pkgdir=$(readlink -e "$2")
pkgdir="${2}"

if [[ -d "${pkgdir}/opt/oomox" ]] ; then
rm -r "${pkgdir}/opt/oomox"
fi
mkdir -p "${pkgdir}/opt/oomox"

cd "${srcdir}"
cp -prf \
./CREDITS \
./LICENSE \
./README.md \
./colors \
./gui.sh \
./oomox_gui \
./plugins \
./po \
./po.mk \
./terminal_templates \
"${pkgdir}/opt/oomox"
rm -rf "${pkgdir}/opt/oomox/plugins/oomoxify/".git*
rm -rf "${pkgdir}/opt/oomox/plugins"/*/*/.git*
rm -rf "${pkgdir}/opt/oomox/plugins/theme_oomox/gtk-theme/".editorconfig
rm -rf "${pkgdir}/opt/oomox/plugins/theme_oomox/gtk-theme/".*.yml
rm -rf "${pkgdir}/opt/oomox/plugins/theme_oomox/gtk-theme/"{D,d}ocker*
rm -rf "${pkgdir}/opt/oomox/plugins/theme_oomox/gtk-theme/"maintenance*
rm -rf "${pkgdir}/opt/oomox/plugins/theme_oomox/gtk-theme/"screenshot*
rm -rf "${pkgdir}/opt/oomox/plugins/theme_oomox/gtk-theme/"test*

cd "${pkgdir}/opt/oomox/"
# will update ./po and produce ./locale dir:
make -f po.mk install
rm "${pkgdir}/opt/oomox/po.mk"

install -Dp -m 755 --target-directory="${pkgdir}/usr/bin/" "${srcdir}/packaging/bin/"*

install -d "${pkgdir}/usr/share/applications/"
install -Dp -m 644 "${srcdir}/packaging/com.github.themix_project.Oomox.desktop" "${pkgdir}/usr/share/applications/"

install -d "${pkgdir}/usr/share/appdata/"
install -Dp -m 644 "${srcdir}/packaging/com.github.themix_project.Oomox.appdata.xml" "${pkgdir}/usr/share/appdata/"

install -Dp -m 644 "${srcdir}/packaging/com.github.themix_project.Oomox-symbolic.svg" "${pkgdir}/usr/share/icons/hicolor/symbolic/apps/com.github.themix_project.Oomox-symbolic.svg"
install -Dp -m 644 "${srcdir}/packaging/com.github.themix_project.Oomox-16.png" "${pkgdir}/usr/share/icons/hicolor/16x16/apps/com.github.themix_project.Oomox.png"
install -Dp -m 644 "${srcdir}/packaging/com.github.themix_project.Oomox-24.png" "${pkgdir}/usr/share/icons/hicolor/24x24/apps/com.github.themix_project.Oomox.png"
install -Dp -m 644 "${srcdir}/packaging/com.github.themix_project.Oomox-32.png" "${pkgdir}/usr/share/icons/hicolor/32x32/apps/com.github.themix_project.Oomox.png"
install -Dp -m 644 "${srcdir}/packaging/com.github.themix_project.Oomox-48.png" "${pkgdir}/usr/share/icons/hicolor/48x48/apps/com.github.themix_project.Oomox.png"
install -Dp -m 644 "${srcdir}/packaging/com.github.themix_project.Oomox-512.png" "${pkgdir}/usr/share/icons/hicolor/512x512/apps/com.github.themix_project.Oomox.png"
make DESTDIR="${pkgdir}" install

exit 0
3 changes: 2 additions & 1 deletion packaging/ubuntu/create_ubuntu_package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ pkgdir=$(readlink -e ./ubuntu_package)
mkdir ${pkgdir}/DEBIAN
cp ${srcdir}/packaging/ubuntu/{control,postinst} ${pkgdir}/DEBIAN

${srcdir}/packaging/install.sh ${srcdir} ${pkgdir}
cd ${srcdir}
make DESTDIR="${pkgdir}" install

cd ${pkgdir}
dpkg-deb --build . oomox.deb
Expand Down

0 comments on commit a5b5f3b

Please sign in to comment.