Skip to content

Commit

Permalink
Fedora package!
Browse files Browse the repository at this point in the history
  • Loading branch information
slideclimb committed Feb 2, 2019
1 parent 12425bb commit 341430f
Show file tree
Hide file tree
Showing 5 changed files with 111 additions and 8 deletions.
7 changes: 1 addition & 6 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
// Gradle file from https://github.com/PHPirates/kotlin-template-project

import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import org.gradle.api.plugins.ExtensionAware

import org.gradle.jvm.tasks.Jar

group = "deltadak"
version = "v1.2.4"
version = "v1.2.5"

plugins {
application
Expand Down Expand Up @@ -69,7 +66,6 @@ dependencies {
compile("org.jetbrains.exposed:exposed:0.11.2")
compile("org.slf4j:slf4j-simple:1.8.0-beta2")


// JUnit 5
testImplementation("org.junit.jupiter:junit-jupiter-api:5.3.2")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.3.2")
Expand Down Expand Up @@ -128,7 +124,6 @@ tasks {
xml.isEnabled = true
xml.destination = file("$buildDir/reports/jacoco/test/jacocoTestReport.xml")
}

}
}

Expand Down
22 changes: 21 additions & 1 deletion index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ Settings of v2.0.0
Instructions for building from source in IntelliJ
-------------------------------------------------

Make sure you have JavaFX installed, for example on Arch Linux you can install the ``java-openjfx`` package. If `javafx` still cannot be resolve, delete and re-add the SDK.
To install java on Fedora, install the ``java-openjdk-devel`` package (the regular ``openjdk`` only contains the jre, and not the jdk).

Make sure you have JavaFX installed, for example on Arch Linux and Fedora you can install the ``java-openjfx`` package. If `javafx` still cannot be resolve, delete and re-add the SDK.

- To run or debug, use the Gradle task ``run``.
- To build an executable jar, use the task ``build``, the file is then
Expand Down Expand Up @@ -90,6 +92,24 @@ Building an Arch Linux release
- Check that it contains the right files with ``pacman -Qlp plep-vx.x.x-1-any.pkg.tar.xz``
- Install with ``sudo pacman -U plep-vx.x.x-1-any.pkg.tar.xz``

Building a Fedora release
-------------------------

- Make sure you have the ``rpm-build`` and ``rpmdevtools`` packages installed.
- Compress the sources into a ``tar`` file, using (in the ``plep`` directory): ``tar czf ~/rpmbuild/SOURCES/plep-x.x.x.tar.gz file1 file2 file3 ... filen``. You should include (at least) the following files/directories:
- ``./gradle``
- ``./releasing/fedora`` (it contains the ``plep.desktop`` file)
- ``./src``
- ``build.gradle.kts``
- ``gradlew``
- ``gradlew.bat``
- ``LICENSE``
- ``settings.gradle.kts``
- Update the version number in ``plep.spec`` and ``build.gradle.kts``.
- Go to ``releasing/fedora``.
- Run ``rpmbuild -bb plep.spec`` to create the rpm file. This will create the rpm file in ``~rpmbuild/RPMS/noarch/``.
- Install the rpm with ``rpm -Uvh plep-x.x.x-y.fc29.noarch``, where ``x.x.x`` is the version number, and ``y`` the release number.


`Javadoc (obsolete)`_
---------------------
Expand Down
2 changes: 1 addition & 1 deletion releasing/arch-linux/PKGBUILD
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#@IgnoreInspection BashAddShebang
# Maintainers: Abby and Thomas at [email protected]
pkgname=plep
pkgver=v1.2.4
pkgver=v1.2.5
pkgrel=1
epoch=
pkgdesc=" An agenda for planning a few tasks per day right on your desktop."
Expand Down
8 changes: 8 additions & 0 deletions releasing/fedora/plep.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[Desktop Entry]
Encoding=UTF-8
Name=Plep
Icon=plep32
Exec=/usr/bin/plep
Terminal=false
Type=Application
Categories=Applications;
80 changes: 80 additions & 0 deletions releasing/fedora/plep.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
Name: plep
Version: 1.2.5
Release: 1%{?dist}
Summary: An agenda for planning a few tasks per day right on your desktop.

License: MIT

URL: https://github.com/deltadak/plep

Source0: %{name}-%{version}.tar.gz
Source1: %{name}.desktop

Requires: java-1.8.0-openjdk-devel, java-1.8.0-openjdk-openjfx

BuildArch: noarch

%define debug_package %{nil}

%description
I am plep.

%prep
# Create a /name folder and extract the tar there (it includes the src
# folder, licence, gradle build files...)
# This also cds into the folder
%setup -c -n %{name}


%build
# "stolen" from build() in the PKGBUILD file in /releasing/arch-linux

# Build the jars, generate database file
./gradlew build

# Generate files in build/install/ such that /plep/bin/plep can be
# executed, and all jars are in /plep/lib.
# (to execute it - for now - go to /plep/bin and run ./plep, otherwise it will look for the global plep, which isn't configured yet.)
./gradlew installDist


%install
# "stolen" from package() in the PKGBUILD file in /releasing/arch-linux

# /usr/bin
mkdir -p %{buildroot}%{_bindir}
# /usr/lib
mkdir -p %{buildroot}/usr/lib/%{name}

# Copy all the install files to /usr/lib/plep
cp -a %{_builddir}/%{name}/build/install/%{name}/. %{buildroot}/usr/lib/%{name}

# Create a file with a command to execute the file which calls java to execute the jar.
echo "#!/bin/sh
/usr/lib/%{name}/bin/%{name}" > %{buildroot}%{_bindir}/%{name}

# Copy an empty database (generated by gradle build) so we can set permissions on it
cp %{_builddir}/%{name}/build/classes/kotlin/plep.db %{buildroot}/usr/lib/%{name}/lib/

# Make plep executable.
chmod a+x %{buildroot}%{_bindir}/%{name}
# Make database folder executable and writable.
chmod a+rwx %{buildroot}/usr/lib/%{name}
# Make database writable.
chmod a+w %{buildroot}/usr/lib/%{name}/lib
chmod a+w %{buildroot}/usr/lib/%{name}/lib/plep.db
chmod a+w %{buildroot}/usr/lib/%{name}/lib/%{name}-v%{version}.jar

# Copy the icon to the place it belongs.
mkdir -p %{buildroot}/usr/share/icons
cp %{_builddir}/%{name}/src/main/resources/plep32.png %{buildroot}/usr/share/icons

# Build the desktop file.
desktop-file-install --dir=%{buildroot}/usr/share/applications %{_builddir}/%{name}/releasing/fedora/%{name}.desktop


%files
%{_bindir}/%{name}
/usr/lib/%{name}
/usr/share/applications/%{name}.desktop
/usr/share/icons/

0 comments on commit 341430f

Please sign in to comment.