Skip to content

Commit

Permalink
debian: initial packaging
Browse files Browse the repository at this point in the history
- clean Makefile and add 'install' target
- refactor spec according to Makefile

QubesOS/qubes-issues#4186
  • Loading branch information
fepitre committed Jun 14, 2020
1 parent 9405ba0 commit 26a8eff
Show file tree
Hide file tree
Showing 18 changed files with 161 additions and 96 deletions.
19 changes: 4 additions & 15 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,4 @@
sudo: required
dist: bionic
language: generic
install: git clone https://github.com/QubesOS/qubes-builder ~/qubes-builder
script: ~/qubes-builder/scripts/travis-build
env:
- DIST_DOM0=fc31 USE_QUBES_REPO_VERSION=4.1 USE_QUBES_REPO_TESTING=1
- DISTS_VM=fc30 USE_QUBES_REPO_VERSION=4.1 USE_QUBES_REPO_TESTING=1
- DISTS_VM=fc31 USE_QUBES_REPO_VERSION=4.1 USE_QUBES_REPO_TESTING=1

# don't build tags which are meant for code signing only
branches:
except:
- /.*_.*/
- build
import:
- source: QubesOS/qubes-continuous-integration:R4.1/travis-base-r4.1.yml
- source: QubesOS/qubes-continuous-integration:R4.1/travis-dom0-r4.1.yml
- source: QubesOS/qubes-continuous-integration:R4.1/travis-vms-r4.1.yml
14 changes: 13 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,2 +1,14 @@
SPECFILE := xfce4-settings-qubes.spec
include Makefile.common

install:
install -m 644 -D xfce4-panel-qubes-default.xml $(DESTDIR)/etc/xdg/xfce4/panel/default.xml.qubes
install -m 644 -D xsettings.xml $(DESTDIR)/etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xsettings.xml.qubes
install -m 644 -D xfwm4.xml $(DESTDIR)/etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfwm4.xml
install -m 644 -D xfce4-desktop.xml $(DESTDIR)/etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-desktop.xml
install -m 644 -D xfce4-session.xml $(DESTDIR)/etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-session.xml.qubes
install -m 644 -D xfce4-power-manager.xml $(DESTDIR)/etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-power-manager.xml.qubes
install -m 644 -D xfce4-keyboard-shortcuts.xml $(DESTDIR)/etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml.qubes
ln -s ../../panel/default.xml $(DESTDIR)/etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml
install -m 644 -D xfce4-xss-lock.desktop $(DESTDIR)/etc/xdg/autostart/xfce4-xss-lock.desktop
install -m 644 -D qubes-update-xfce-config.desktop $(DESTDIR)/etc/xdg/autostart/qubes-update-xfce-config.desktop
install -m 755 -D update-xfce-config $(DESTDIR)/usr/lib/qubes/update-xfce-config
1 change: 1 addition & 0 deletions Makefile.builder
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
RPM_SPEC_FILES := xfce4-settings-qubes.spec
DEBIAN_BUILD_DIRS := debian
53 changes: 0 additions & 53 deletions Makefile.common

This file was deleted.

5 changes: 5 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
xfce4-settings-qubes (4.0.3-2) unstable; urgency=medium

Initial commit

-- Frédéric Pierret (fepitre) <[email protected]> Sun, 14 Jun 2020 10:00:00 +0200
1 change: 1 addition & 0 deletions debian/compat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
9
14 changes: 14 additions & 0 deletions debian/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Source: xfce4-settings-qubes
Section: xfce
Priority: extra
Maintainer: Frédéric Pierret (fepitre) <[email protected]>
Build-Depends:
debhelper (>= 9~)
Standards-Version: 3.9.5
Homepage: http://www.qubes-os.org

Package: xfce4-settings-qubes
Section: xfce
Architecture: amd64
Depends: qubes-artwork, xfce4-panel, xss-lock, ${shlibs:Depends}, ${misc:Depends}
Description: Default Xfce4 panel settings for Qubes.
22 changes: 22 additions & 0 deletions debian/copyright
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: desktop-linux-xfce4
Source: <http://www.qubes-os.org/>

Files: debian/*
Copyright: 2020 Frédéric Pierret (fepitre) <[email protected]> License: GPL-2+
License: GPL-2+
This package is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
.
This package is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>
.
On Debian systems, the complete text of the GNU General
Public License version 2 can be found in "/usr/share/common-licenses/GPL-2".
11 changes: 11 additions & 0 deletions debian/install
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
etc/xdg/xfce4/panel/default.xml.qubes
etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xsettings.xml.qubes
etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfwm4.xml
etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-desktop.xml
etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml
etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-session.xml.qubes
etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-power-manager.xml.qubes
etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml.qubes
etc/xdg/autostart/xfce4-xss-lock.desktop
etc/xdg/autostart/qubes-update-xfce-config.desktop
usr/lib/qubes/update-xfce-config
23 changes: 23 additions & 0 deletions debian/postinst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/sh

set -e

settings_replace() {
origfile="$1"
qubesfile="${1}.qubes"
backupfile=${origfile}.xfce4
if [ -r "$origfile" ] && [ ! -r "$backupfile" ]; then
mv -f "$origfile" "$backupfile"
fi
cp -f "$qubesfile" "$origfile"
}

if [ "$1" = trigerred ]; then
for trigger in $2; do
settings_replace "$trigger"
done
fi

#DEBHELPER#

exit 0
24 changes: 24 additions & 0 deletions debian/postrm
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/sh

set -e

# remove alternatives links

if [ "$1" = "remove" ]; then
REPLACEFILE="${REPLACEFILE} /etc/xdg/xfce4/panel/default.xml.qubes"
REPLACEFILE="${REPLACEFILE} /etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xsettings.xml.qubes"
REPLACEFILE="${REPLACEFILE} /etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-session.xml.qubes"
REPLACEFILE="${REPLACEFILE} /etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-power-manager.xml.qubes"
REPLACEFILE="${REPLACEFILE} /etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml.qubes"
if [ $1 -lt 1 ]; then
for file in ${REPLACEFILE}; do
origfile=${file%.qubes}
backupfile=${origfile}.xfce4
mv -f "$backupfile" "$origfile"
done
fi
fi

#DEBHELPER#

exit 0
13 changes: 13 additions & 0 deletions debian/rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/make -f

include /usr/share/dpkg/default.mk
export DESTDIR=$(shell pwd)/debian/tmp

%:
dh $@

override_dh_auto_install:
make install

override_dh_install:
dh_install --fail-missing
1 change: 1 addition & 0 deletions debian/source/format
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.0 (quilt)
4 changes: 4 additions & 0 deletions debian/source/options
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
extend-diff-ignore = "(^|/)(.git/.*)$"
extend-diff-ignore = "(^|/)(deb/.*)$"
extend-diff-ignore = "(^|/)(pkgs/.*)$"
extend-diff-ignore = "(^|/)(rpm/.*)$"
5 changes: 5 additions & 0 deletions debian/triggers
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
interest-noawait /etc/xdg/xfce4/panel/default.xml
interest-noawait /etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xsettings.xml
interest-noawait /etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-session.xml
interest-noawait /etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-power-manager.xml
interest-noawait /etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml
1 change: 1 addition & 0 deletions rel
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2
1 change: 1 addition & 0 deletions version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
4.0.3
45 changes: 18 additions & 27 deletions xfce4-settings-qubes.spec → xfce4-settings-qubes.spec.in
Original file line number Diff line number Diff line change
@@ -1,53 +1,36 @@
Name: xfce4-settings-qubes
Version: 4.0.3
Release: 2%{?dist}
Version: @VERSION@
Release: @REL@%{?dist}
Summary: Default Xfce4 panel settings for Qubes

Group: User Interface/Desktops
License: GPLv2+
URL: http://www.qubes-os.org/
Source0: xfce4-panel-qubes-default.xml
Source2: xsettings.xml
Source3: xfwm4.xml
Source4: xfce4-desktop.xml
Source5: xfce4-session.xml
Source6: xfce4-power-manager.xml
Source7: xfce4-keyboard-shortcuts.xml
Source8: xfce4-xss-lock.desktop
Source9: qubes-update-xfce-config.desktop
Source10: update-xfce-config
Source0: %{name}-%{version}.tar.gz

Requires: qubes-artwork
Requires: xfce4-panel
Requires: xss-lock
Requires(post): xfce4-panel


%description
%{summary}

%prep

%build
%prep
%setup -q


%install
install -m 644 -D %{SOURCE0} %{buildroot}%{_sysconfdir}/xdg/xfce4/panel/default.xml.qubes
install -m 644 -D %{SOURCE2} %{buildroot}%{_sysconfdir}/xdg/xfce4/xfconf/xfce-perchannel-xml/xsettings.xml.qubes
install -m 644 -D %{SOURCE3} %{buildroot}%{_sysconfdir}/xdg/xfce4/xfconf/xfce-perchannel-xml/xfwm4.xml
install -m 644 -D %{SOURCE4} %{buildroot}%{_sysconfdir}/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-desktop.xml
install -m 644 -D %{SOURCE5} %{buildroot}%{_sysconfdir}/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-session.xml.qubes
install -m 644 -D %{SOURCE6} %{buildroot}%{_sysconfdir}/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-power-manager.xml.qubes
install -m 644 -D %{SOURCE7} %{buildroot}%{_sysconfdir}/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml.qubes
ln -s ../../panel/default.xml %{buildroot}%{_sysconfdir}/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml
install -m 644 -D %{SOURCE8} %{buildroot}%{_sysconfdir}/xdg/autostart/xfce4-xss-lock.desktop
install -m 644 -D %{SOURCE9} %{buildroot}%{_sysconfdir}/xdg/autostart/qubes-update-xfce-config.desktop
install -m 755 -D %{SOURCE10} %{buildroot}/usr/lib/qubes/update-xfce-config
%make_install


%define settings_replace() \
qubesfile="%{1}" \
origfile=${qubesfile%.qubes} \
backupfile=${origfile}.xfce4 \
if [ -r "$origfile" -a ! -r "$backupfile" ]; then \
if [ -r "$origfile" ] && [ ! -r "$backupfile" ]; then \
mv -f "$origfile" "$backupfile" \
fi \
cp -f "$qubesfile" "$origfile" \
Expand All @@ -56,18 +39,23 @@ cp -f "$qubesfile" "$origfile" \
%triggerin -- xfce4-panel
%settings_replace %{_sysconfdir}/xdg/xfce4/panel/default.xml.qubes


%triggerin -- xfce4-settings
%settings_replace %{_sysconfdir}/xdg/xfce4/xfconf/xfce-perchannel-xml/xsettings.xml.qubes


%triggerin -- xfce4-session
%settings_replace %{_sysconfdir}/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-session.xml.qubes


%triggerin -- xfce4-power-manager
%settings_replace %{_sysconfdir}/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-power-manager.xml.qubes


%triggerin -- libxfce4ui
%settings_replace %{_sysconfdir}/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml.qubes


%triggerin -- xscreensaver-base

conffile=/etc/xscreensaver/XScreenSaver.ad.tail
Expand All @@ -85,6 +73,7 @@ sed -e '/! Qubes options begin/,/! Qubes options end/c \

update-xscreensaver-hacks


%postun
REPLACEFILE="${REPLACEFILE} %{_sysconfdir}/xdg/xfce4/panel/default.xml.qubes"
REPLACEFILE="${REPLACEFILE} %{_sysconfdir}/xdg/xfce4/xfconf/xfce-perchannel-xml/xsettings.xml.qubes"
Expand All @@ -99,6 +88,7 @@ if [ $1 -lt 1 ]; then
done
fi


%files
%{_sysconfdir}/xdg/xfce4/panel/default.xml.qubes
%{_sysconfdir}/xdg/xfce4/xfconf/xfce-perchannel-xml/xsettings.xml.qubes
Expand All @@ -112,5 +102,6 @@ fi
%{_sysconfdir}/xdg/autostart/qubes-update-xfce-config.desktop
/usr/lib/qubes/update-xfce-config

%changelog

%changelog
@CHANGELOG@

0 comments on commit 26a8eff

Please sign in to comment.