diff --git a/README.md b/README.md index 38c05fdc..7cbb819c 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,7 @@ - [Fedora](#fedora) - [Arch](#arch) - [Install](#install) +- [Packaging](#packaging) - [License](#license) ## Features @@ -83,11 +84,6 @@ apt install -y git g++ build-essential qt5-qmake qt5-default Compilation: run `qmake && make` in the main directory. -Runtime Dependencies (not needed if compiled from source): -```` -apt install -y libqt5dbus5, libqt5network5, libqt5core5a, libqt5widgets5, libqt5gui5 -```` - ### Fedora Compilation Dependencies: ```` @@ -96,11 +92,6 @@ dnf install -y qt5-devel gcc-c++ git qt5-qtbase-devel Compilation: run `qmake-qt5 && make` in the main directory. -Runtime Dependencies (not needed if compiled from source): -```` -dnf install -y qt5-qtbase -```` - ### Arch Compilation Dependencies: ```` @@ -109,15 +100,37 @@ pacman -S git qt5-base base-devel Compilation: run `qmake && make` in the main directory. -Runtime Dependencies (not needed if compiled from source): -```` -pacman -S qt5-base -```` - -## Install +### Install Simply use `make install` with privileges. +## Packaging + +In order to generate the makefile installing in `/usr` instead of in `/usr/local` you can use the `packaging` option to generate the proper makefile (`qmake CONFIG+=packaging` instead of just `qmake`). + +If you want to install in a custom directory you can define the `BASEDIR` variable. + +**Example**: +You whant to install Flameshot in ~/myBuilds/test. You would execute the following to do so: +`qmake CONFIG+=packaging BASEDIR=~/myBuilds/test && make install` + +### Runtime Dependencies + +**Debian**: +```` +libqt5dbus5, libqt5network5, libqt5core5a, libqt5widgets5, libqt5gui5 +```` + +**Fedora**: +```` +qt5-qtbase +```` + +**Arch**: +```` +qt5-base +```` + ## License - The main code is licensed under [GPLv3](./LICENSE) - The logo of Flameshot is licensed under [Free Art License v1.3](./img/flameshotLogoLicense.txt) diff --git a/dbus/org.dharkael.Flameshot.service b/dbus/make/org.dharkael.Flameshot.service similarity index 100% rename from dbus/org.dharkael.Flameshot.service rename to dbus/make/org.dharkael.Flameshot.service diff --git a/dbus/package/org.dharkael.Flameshot.service b/dbus/package/org.dharkael.Flameshot.service new file mode 100644 index 00000000..6b11aac6 --- /dev/null +++ b/dbus/package/org.dharkael.Flameshot.service @@ -0,0 +1,3 @@ +[D-BUS Service] +Name=org.dharkael.Flameshot +Exec=/usr/bin/flameshot diff --git a/docs/desktopEntry/make/flameshot-init.desktop b/docs/desktopEntry/make/flameshot-init.desktop new file mode 100755 index 00000000..214e039f --- /dev/null +++ b/docs/desktopEntry/make/flameshot-init.desktop @@ -0,0 +1,16 @@ +[Desktop Entry] +Encoding=UTF-8 +Name=Launch Flameshot +Name[es]=Iniciar Flameshot +GenericName=Screenshot tool +GenericName[es]=Herramienta de captura de pantalla +Comment=Powerfull yet simple to use screenshot software. +Comment[es]=Potente pero simple de usar software de capturas. +Exec=/usr/local/bin/flameshot +TryExec=/usr/local/bin/flameshot +Icon=/usr/local/share/icons/flameshot.png +Terminal=false +Type=Application +Categories=Graphics +StartupNotify=false + diff --git a/docs/desktopEntry/package/flameshot-init.desktop b/docs/desktopEntry/package/flameshot-init.desktop new file mode 100644 index 00000000..da8059e9 --- /dev/null +++ b/docs/desktopEntry/package/flameshot-init.desktop @@ -0,0 +1,15 @@ +[Desktop Entry] +Encoding=UTF-8 +Name=Launch Flameshot +Name[es]=Iniciar Flameshot +GenericName=Screenshot tool +GenericName[es]=Herramienta de captura de pantalla +Comment=Powerfull yet simple to use screenshot software. +Comment[es]=Potente pero simple de usar software de capturas. +Exec=/usr/bin/flameshot +TryExec=/usr/bin/flameshot +Icon=/usr/share/icons/flameshot.png +Terminal=false +Type=Application +Categories=Graphics +StartupNotify=false diff --git a/flameshot.pro b/flameshot.pro index 5868c4e5..79830e44 100644 --- a/flameshot.pro +++ b/flameshot.pro @@ -13,6 +13,8 @@ greaterThan(QT_MAJOR_VERSION, 4): QT += widgets CONFIG += c++11 CONFIG += link_pkgconfig +#CONFIG += packaging # Enables "make install" for packaging paths + TARGET = flameshot TEMPLATE = app @@ -70,27 +72,41 @@ RESOURCES += \ # installs unix: { - target.path = /usr/local/bin/ + packaging { + USRPATH = /usr + } else { + USRPATH = /usr/local + } - qmfile.path = /usr/share/flameshot/translations/ + target.path = $${BASEDIR}$${USRPATH}/bin/ + + qmfile.path = $${BASEDIR}/usr/share/flameshot/translations/ qmfile.files = translation/Internationalization_es.qm - servicedbus.path = /usr/share/dbus-1/services/ - servicedbus.files = dbus/org.dharkael.Flameshot.service - - dbus.path = /usr/share/dbus-1/interfaces/ + dbus.path = $${BASEDIR}/usr/share/dbus-1/interfaces/ dbus.files = dbus/org.dharkael.Flameshot.xml - icon.path = /usr/local/share/icons/ + icon.path = $${BASEDIR}$${USRPATH}/share/icons/ icon.files = img/flameshot.png - desktopentry.path = /usr/local/share/applications - desktopentry.files = docs/desktopEntry/make/flameshot.desktop + desktopentry.path = $${BASEDIR}$${USRPATH}/share/applications + desktopentryinit.path = $${BASEDIR}$${USRPATH}/share/applications + servicedbus.path = $${BASEDIR}/usr/share/dbus-1/services/ + packaging { + desktopentry.files = docs/desktopEntry/package/flameshot.desktop + desktopentryinit.files = docs/desktopEntry/package/flameshot-init.desktop + servicedbus.files = dbus/package/org.dharkael.Flameshot.service + } else { + desktopentry.files = docs/desktopEntry/make/flameshot.desktop + desktopentryinit.files = docs/desktopEntry/make/flameshot-init.desktop + servicedbus.files = dbus/make/org.dharkael.Flameshot.service + } INSTALLS += target \ icon \ desktopentry \ + desktopentryinit \ qmfile \ servicedbus \ dbus