diff --git a/build.sh b/build.sh index 279a5bd57..6c483d336 100755 --- a/build.sh +++ b/build.sh @@ -32,4 +32,4 @@ while [ $# -gt 0 ]; do done # provide defaults, then pass everything else as-is -. ./eng/linux/package.sh -o "${output}" -c "${config}" "${options[@]}" +. ./eng/linux/package.sh -o "${output}" -c "${config}" "${options[@]}" --generate-rules false diff --git a/eng/linux/BinaryTarBall/package.sh b/eng/linux/BinaryTarBall/package.sh index 7b511b02a..d784c35d4 100755 --- a/eng/linux/BinaryTarBall/package.sh +++ b/eng/linux/BinaryTarBall/package.sh @@ -4,30 +4,21 @@ PKG_FILE="${OTD_LNAME}-${OTD_VERSION}-x64.tar.gz" output="${1}" -move_to_nested "${output}" "${output}/lib/opentabletdriver" +move_to_nested "${output}" "${output}/build" echo "Copying generic files..." -cp -R "${GENERIC_FILES}"/* "${output}/" -mkdir -p "${output}/etc/" -mv "${output}/usr/lib"/* "${output}/etc/" - -echo "Patching wrapper scripts to point to '/lib/opentabletdriver'..." -mkdir -p "${output}/bin" -for exe in "${output}/usr/bin"/*; do - sed -i "s|#!/usr/bin/env sh|#!/bin/sh|" "${exe}" - sed -i "s|/usr/lib|/lib|" "${exe}" - mv "${exe}" "${output}/bin/${exe##*/}" -done +env DESTDIR="${output}/usr/local" OTD_BUILD_DIR="${output}/build" "${GENERIC_FILES}/install.sh" +rm -r "${output}/build" -echo "Removing unused directories..." -rmdir "${output}/usr/bin" -rmdir "${output}/usr/lib" -rmdir "${output}/usr" +echo "Patching wrapper scripts to point to '/usr/local/lib/opentabletdriver'..." +for exe in "${output}/usr/local/bin"/*; do + sed -i "s|/usr/lib|/usr/local/lib|" "${exe}" +done -generate_rules "${output}/etc/udev/rules.d/99-opentabletdriver.rules" -generate_desktop_file "${output}/share/applications/opentabletdriver.desktop" -sed -i "s|/usr/share|/share|" "${output}/share/applications/opentabletdriver.desktop" -copy_pixmap_assets "${output}/share/pixmaps" +mkdir -p "${output}/etc/udev/rules.d/" +mv "${output}/usr/local/lib/udev/rules.d/99-opentabletdriver.rules" "${output}/etc/udev/rules.d/99-opentabletdriver.rules" +rm -r "${output}/usr/local/lib/udev/" +sed -i "s|/usr/share|/usr/local/share|" "${output}/usr/local/share/applications/opentabletdriver.desktop" echo "Creating binary tarball '${output}/${PKG_FILE}'..." diff --git a/eng/linux/Debian/DEBIAN/postinst b/eng/linux/Debian/DEBIAN/postinst deleted file mode 100755 index 5f2aa4c07..000000000 --- a/eng/linux/Debian/DEBIAN/postinst +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh - -BOLD_YELLOW='\033[1;33m' -RESET='\033[0m' - -set -e - -if [ "$1" = "configure" ]; then - if lsmod | grep hid_uclogic > /dev/null; then - rmmod hid_uclogic || true - fi - - if lsmod | grep wacom > /dev/null; then - rmmod wacom || true - fi - - if udevadm control --reload-rules; then - udevadm trigger --settle || true - udevadm trigger --name-match=uinput --settle || true - fi - - printf "${BOLD_YELLOW}Run the daemon by invoking 'otd-daemon', or by enabling opentabletdriver.service${RESET}" -fi diff --git a/eng/linux/Debian/debian/compat b/eng/linux/Debian/debian/compat new file mode 100644 index 000000000..9a037142a --- /dev/null +++ b/eng/linux/Debian/debian/compat @@ -0,0 +1 @@ +10 \ No newline at end of file diff --git a/eng/linux/Debian/debian/opentabletdriver.install b/eng/linux/Debian/debian/opentabletdriver.install new file mode 100644 index 000000000..9eeff3820 --- /dev/null +++ b/eng/linux/Debian/debian/opentabletdriver.install @@ -0,0 +1,12 @@ +usr/bin/otd +usr/bin/otd-daemon +usr/bin/otd-gui +usr/lib/modprobe.d/99-opentabletdriver.conf +usr/lib/opentabletdriver/* +usr/lib/systemd/user/opentabletdriver.service +usr/lib/udev/rules.d/99-opentabletdriver.rules +usr/share/applications/opentabletdriver.desktop +usr/share/man/man8/opentabletdriver.8.gz +usr/share/doc/opentabletdriver/LICENSE +usr/share/pixmaps/otd.ico +usr/share/pixmaps/otd.png diff --git a/eng/linux/Debian/debian/rules b/eng/linux/Debian/debian/rules new file mode 100755 index 000000000..c9cef22db --- /dev/null +++ b/eng/linux/Debian/debian/rules @@ -0,0 +1,11 @@ +#!/usr/bin/make -f +SHELL=/usr/bin/env bash + +%: + dh $@ + +override_dh_auto_build: + ./eng/linux/package.sh -o "bin" -c "Release" + +override_dh_auto_install: + DESTDIR=debian/tmp/usr OTD_BUILD_DIR=bin ./eng/linux/Generic/install.sh diff --git a/eng/linux/Debian/debian/source/format b/eng/linux/Debian/debian/source/format new file mode 100644 index 000000000..89ae9db8f --- /dev/null +++ b/eng/linux/Debian/debian/source/format @@ -0,0 +1 @@ +3.0 (native) diff --git a/eng/linux/Debian/package.sh b/eng/linux/Debian/package.sh index a996dcdce..6bb45c843 100755 --- a/eng/linux/Debian/package.sh +++ b/eng/linux/Debian/package.sh @@ -1,9 +1,5 @@ #!/usr/bin/env bash -# in the future if we want to be part of official debian repos, we need to -# provide a manpage for the binaries in /usr/bin, and add a source package -# where the binaries could be built from. - # increment this when releasing a new package of the same upstream version # where the only changes are to the packaging itself PKG_VER="1" @@ -13,54 +9,47 @@ debian_src="$(readlink -f $(dirname "${BASH_SOURCE[0]}"))" output="${1}" -move_to_nested "${output}" "${output}/usr/lib/opentabletdriver" - -echo "Copying generic files..." -cp -R "${GENERIC_FILES}"/* "${output}/" +echo "Copying source files..." +create_source_tarball "${OTD_LNAME}-${OTD_VERSION}" | tar -xf - -C "${output}" echo "Debianizing..." -mkdir -p "${output}/debian" -touch "${output}/debian/control" - -echo "Generating shlibdeps..." -last_cwd="${PWD}" -cd "${output}" -shlibdeps="$(dpkg-shlibdeps -O "usr/lib/opentabletdriver/OpenTabletDriver.Daemon" 2> /dev/null)" -shlibdeps="${shlibdeps#shlibs:Depends=}" -cd "${last_cwd}" -mv "${output}"/{debian,DEBIAN} +cp -R "${debian_src}/debian" "${output}/${OTD_LNAME}-${OTD_VERSION}" +cp "${GENERIC_FILES}/Scripts/postinst" "${output}/${OTD_LNAME}-${OTD_VERSION}/debian/${OTD_LNAME}.postinst" +cp "${GENERIC_FILES}/Scripts/postrm" "${output}/${OTD_LNAME}-${OTD_VERSION}/debian/${OTD_LNAME}.postrm" -echo "Copying Debian files..." -cp -R "${debian_src}/DEBIAN" "${output}" -cp -R "${debian_src}/usr" "${output}" - -generate_rules "${output}/usr/lib/udev/rules.d/99-opentabletdriver.rules" -generate_desktop_file "${output}/usr/share/applications/opentabletdriver.desktop" -copy_pixmap_assets "${output}/usr/share/pixmaps" - -echo "Generating DEBIAN/control..." -cat << EOF > "${output}/DEBIAN/control" -Package: ${OTD_LNAME} -Version: ${OTD_VERSION}-${PKG_VER} -Section: misc +echo "Generating debian/control..." +cat << EOF > "${output}/${OTD_LNAME}-${OTD_VERSION}/debian/control" +Source: opentabletdriver Priority: optional +Build-Depends: dotnet-sdk-6.0 +Maintainer: InfinityGhost , X9VoiD + +Package: opentabletdriver +Section: base Architecture: amd64 -Installed-Size: $(du -s "${output}" | cut -f1) Pre-Depends: udev -Depends: libevdev2, libgtk-3-0, dotnet-runtime-6.0, ${shlibdeps} +Depends: libevdev2, libgtk-3-0, dotnet-runtime-6.0, \${shlibs:Depends} Recommends: libx11-6, libxrandr2 -Conflicts: ${OTD_NAME} -Replaces: ${OTD_NAME} -Maintainer: ${OTD_MAINTAINERS[1]} Description: A ${OTD_DESC} $(echo "${OTD_LONG_DESC}" | sed '2,$s/^/ /') . $(echo "${OTD_LONG_DESC2}" | sed '2,$s/^/ /') Homepage: ${OTD_UPSTREAM_URL} -Vcs-Browser: ${OTD_REPO_URL} -Vcs-Git: ${OTD_GIT} EOF +echo "Generating debian/changelog..." +cat < "${output}/${OTD_LNAME}-${OTD_VERSION}/debian/changelog" +opentabletdriver (${OTD_VERSION}-${PKG_VER}) unstable; urgency=low + + * New version: ${OTD_VERSION}-${PKG_VER} + + -- InfinityGhost `LANG=C date +"%a, %d %b %Y %X %z"` + +EOF + +PREV_DIR="${PWD}" echo "Creating '${PKG_FILE}'..." -move_to_nested "${output}" "${output}/opentabletdriver" -dpkg-deb --build --root-owner-group "${output}/opentabletdriver" "${output}/${PKG_FILE}" +cd "${output}/${OTD_LNAME}-${OTD_VERSION}" +dpkg-buildpackage --no-sign -b +cd "${PREV_DIR}" +mv "${output}/${OTD_LNAME}_${OTD_VERSION}-${PKG_VER}_amd64.deb" "${output}/${PKG_FILE}" diff --git a/eng/linux/Debian/usr/share/doc/opentabletdriver/copyright b/eng/linux/Debian/usr/share/doc/opentabletdriver/copyright deleted file mode 100644 index b53db4002..000000000 --- a/eng/linux/Debian/usr/share/doc/opentabletdriver/copyright +++ /dev/null @@ -1,29 +0,0 @@ -Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ -Upstream-Name: OpenTabletDriver -Source: https://github.com/OpenTabletDriver/OpenTabletDriver - -Files: * -Copyright: Copyright 2019-2023 InfinityGhost -License: LGPL-3+ - -Files: debian/* -Copyright: Copyright 2019-2023 InfinityGhost -License: LGPL-3+ - -License: LGPL-3+ - This package is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 3 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 - Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public - License along with this package; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -On Debian systems, the complete text of the GNU Lesser General - Public License can be found in `/usr/share/common-licenses/LGPL-3'. diff --git a/eng/linux/Generic/usr/bin/otd b/eng/linux/Generic/Scripts/otd similarity index 100% rename from eng/linux/Generic/usr/bin/otd rename to eng/linux/Generic/Scripts/otd diff --git a/eng/linux/Generic/usr/bin/otd-daemon b/eng/linux/Generic/Scripts/otd-daemon similarity index 100% rename from eng/linux/Generic/usr/bin/otd-daemon rename to eng/linux/Generic/Scripts/otd-daemon diff --git a/eng/linux/Generic/usr/bin/otd-gui b/eng/linux/Generic/Scripts/otd-gui similarity index 100% rename from eng/linux/Generic/usr/bin/otd-gui rename to eng/linux/Generic/Scripts/otd-gui diff --git a/eng/linux/Generic/Scripts/postinst b/eng/linux/Generic/Scripts/postinst new file mode 100755 index 000000000..56003f846 --- /dev/null +++ b/eng/linux/Generic/Scripts/postinst @@ -0,0 +1,18 @@ +#!/bin/sh + +set -e + +if lsmod | grep hid_uclogic > /dev/null; then + rmmod hid_uclogic || true +fi + +if lsmod | grep wacom > /dev/null; then + rmmod wacom || true +fi + +if udevadm control --reload-rules; then + udevadm trigger --settle || true + udevadm trigger --name-match=uinput --settle || true +fi + +printf "Run the daemon by invoking 'otd-daemon', or by enabling opentabletdriver.service" diff --git a/eng/linux/Debian/DEBIAN/postrm b/eng/linux/Generic/Scripts/postrm similarity index 100% rename from eng/linux/Debian/DEBIAN/postrm rename to eng/linux/Generic/Scripts/postrm diff --git a/eng/linux/Generic/install.sh b/eng/linux/Generic/install.sh new file mode 100755 index 000000000..f11ad6393 --- /dev/null +++ b/eng/linux/Generic/install.sh @@ -0,0 +1,47 @@ +#!/usr/bin/env bash + +DESTDIR="${DESTDIR:-/usr/local/}" +generic_src="$(readlink -f $(dirname "${BASH_SOURCE[0]}"))" + +. ${generic_src}/../lib.sh + +if [ ! -d "${OTD_BUILD_DIR}" ]; then + echo "OTD_BUILD_DIR is not set, please build OpenTabletDriver and set this variable." + exit 1 +fi + +# Scripts +mkdir -p "${DESTDIR}/bin" +install -m 0755 "${generic_src}/Scripts/otd" "${DESTDIR}/bin/otd" +install -m 0755 "${generic_src}/Scripts/otd-daemon" "${DESTDIR}/bin/otd-daemon" +install -m 0755 "${generic_src}/Scripts/otd-gui" "${DESTDIR}/bin/otd-gui" + +# modprobe +mkdir -p "${DESTDIR}/lib/modprobe.d" +install -m 0644 "${generic_src}/modprobe/99-opentabletdriver.conf" "${DESTDIR}/lib/modprobe.d/99-opentabletdriver.conf" + +# systemd user +mkdir -p "${DESTDIR}/lib/systemd/user" +install -m 0644 "${generic_src}/systemd-user/opentabletdriver.service" "${DESTDIR}/lib/systemd/user/opentabletdriver.service" + +# manpages +mkdir -p "${DESTDIR}/share/man/man8" +gzip -c "${generic_src}/manpages/opentabletdriver.8" > "${DESTDIR}/share/man/man8/opentabletdriver.8.gz" + +# license +mkdir -p "${DESTDIR}/share/doc/opentabletdriver" +install -m 0644 "${REPO_ROOT}/LICENSE" "${DESTDIR}/share/doc/opentabletdriver/LICENSE" + +# pixmaps +copy_pixmap_assets "${DESTDIR}/share/pixmaps" + +# udev rules +mkdir -p "${DESTDIR}/lib/udev/rules.d" +mv "${OTD_BUILD_DIR}/99-opentabletdriver.rules" "${DESTDIR}/lib/udev/rules.d/99-opentabletdriver.rules" + +# desktop entry +generate_desktop_file "${DESTDIR}/share/applications/opentabletdriver.desktop" + +# OpenTabletDriver +mkdir -p "${DESTDIR}/lib/opentabletdriver" +cp -r "${OTD_BUILD_DIR}"/* "${DESTDIR}/lib/opentabletdriver" diff --git a/docs/manpages/opentabletdriver.8 b/eng/linux/Generic/manpages/opentabletdriver.8 similarity index 100% rename from docs/manpages/opentabletdriver.8 rename to eng/linux/Generic/manpages/opentabletdriver.8 diff --git a/eng/linux/Generic/usr/lib/modprobe.d/99-opentabletdriver.conf b/eng/linux/Generic/modprobe/99-opentabletdriver.conf similarity index 100% rename from eng/linux/Generic/usr/lib/modprobe.d/99-opentabletdriver.conf rename to eng/linux/Generic/modprobe/99-opentabletdriver.conf diff --git a/eng/linux/Generic/usr/lib/systemd/user/opentabletdriver.service b/eng/linux/Generic/systemd-user/opentabletdriver.service similarity index 100% rename from eng/linux/Generic/usr/lib/systemd/user/opentabletdriver.service rename to eng/linux/Generic/systemd-user/opentabletdriver.service diff --git a/eng/linux/RedHat/package.sh b/eng/linux/RedHat/package.sh index b286b384f..a2da6f2e2 100644 --- a/eng/linux/RedHat/package.sh +++ b/eng/linux/RedHat/package.sh @@ -1,7 +1,5 @@ #!/usr/bin/env bash -# no SRPM for now - # increment this when releasing a new package of the same upstream version # where the only changes are to the packaging itself PKG_VER="1" @@ -11,44 +9,33 @@ redhat_src="$(readlink -f $(dirname "${BASH_SOURCE[0]}"))" output="$(readlink -f "${1}")" -move_to_nested "${output}" "${output}/tmp" - echo "RPMizing..." mkdir -p "${output}"/{BUILD,RPMS,SOURCES,SPECS,SRPMS} -build_src="${output}/BUILD" -move_to_nested "${output}/tmp" "${build_src}/usr/lib/${OTD_LNAME}" -rm -r "${output}/tmp" - -echo "Copying generic files..." -cp -R "${GENERIC_FILES}"/* "${build_src}" - -echo "Copying RedHat files..." -cp -R "${redhat_src}/usr" "${build_src}" - -generate_rules "${build_src}/usr/lib/udev/rules.d/99-${OTD_LNAME}.rules" -generate_desktop_file "${build_src}/usr/share/applications/${OTD_LNAME}.desktop" -copy_pixmap_assets "${build_src}/usr/share/pixmaps" +echo "Making a source tarball..." +create_source_tarball "${OTD_LNAME}-${OTD_VERSION}" | gzip -c > "${output}/SOURCES/${OTD_LNAME}-${OTD_VERSION}.tar.gz" echo "Generating ${OTD_LNAME}.spec..." -cat << EOF > "${output}/${OTD_LNAME}.spec" +cat << EOF > "${output}/SPECS/${OTD_LNAME}.spec" Name: ${OTD_LNAME} -Obsoletes: ${OTD_NAME} Version: ${OTD_VERSION} Release: ${PKG_VER}%{?dist} Summary: A ${OTD_DESC} -BuildArch: x86_64 + +Source0: ${OTD_LNAME}-${OTD_VERSION}.tar.gz License: LGPLv3 URL: ${OTD_UPSTREAM_URL} AutoReq: 0 Requires: dotnet-runtime-6.0 -Requires: libevdev Requires: gtk3 Suggests: libX11 Suggests: libXrandr +# libevdev is libevdev2 on SUSE, and libevdev on RHEL/Fedora... +Requires: libevdev.so.2()(64bit) + %description ${OTD_LONG_DESC} @@ -60,45 +47,25 @@ ${OTD_LONG_DESC2} # No stripping %global __os_install_post %{nil} -%clean - %prep +%autosetup %build +./eng/linux/package.sh -o "bin" -c "Release" %install export DONT_STRIP=1 +export DESTDIR="%{buildroot}/%{_prefix}" +export OTD_BUILD_DIR="bin" +./eng/linux/Generic/install.sh -mkdir -p %{buildroot}/usr/lib/${OTD_LNAME} -cp -r %{_builddir}/* %{buildroot} - -%pre +%post -f eng/linux/Generic/Scripts/postinst -%post -BOLD_YELLOW='\033[1;33m' -RESET='\033[0m' - -if lsmod | grep hid_uclogic > /dev/null; then - rmmod hid_uclogic || true -fi - -if lsmod | grep wacom > /dev/null; then - rmmod wacom || true -fi - -if udevadm control --reload-rules; then - udevadm trigger --settle || true - udevadm trigger --name-match=uinput --settle || true -fi - -printf "\${BOLD_YELLOW}Run the daemon by invoking 'otd-daemon', or by enabling opentabletdriver.service\${RESET}" - -%preun - -%postun +%postun -f eng/linux/Generic/Scripts/postrm %files %defattr(-,root,root) +%dir %{_prefix}/lib/opentabletdriver %{_bindir}/otd %{_bindir}/otd-daemon %{_bindir}/otd-gui @@ -107,16 +74,18 @@ printf "\${BOLD_YELLOW}Run the daemon by invoking 'otd-daemon', or by enabling o %{_prefix}/lib/systemd/user/opentabletdriver.service %{_prefix}/lib/udev/rules.d/99-opentabletdriver.rules %{_prefix}/share/applications/opentabletdriver.desktop -%{_prefix}/share/licenses/opentabletdriver/LICENSE +%{_prefix}/share/man/man8/opentabletdriver.8.gz +%{_prefix}/share/doc/opentabletdriver/LICENSE %{_prefix}/share/pixmaps/otd.ico %{_prefix}/share/pixmaps/otd.png %changelog EOF - moved_output="${output}/opentabletdriver" move_to_nested "${output}" "${moved_output}" -rpmbuild -D "_topdir ${moved_output}" -bb "${moved_output}/${OTD_LNAME}.spec" + +echo "Building RPM..." +rpmbuild -D "_topdir ${moved_output}" -bb "${moved_output}/SPECS/${OTD_LNAME}.spec" PKG_FILE="$(basename "$(ls "${moved_output}/RPMS/x86_64/${OTD_LNAME}"*.rpm)")" mv "${moved_output}/RPMS/x86_64/${PKG_FILE}" "${output}" diff --git a/eng/linux/RedHat/usr/share/licenses/opentabletdriver/LICENSE b/eng/linux/RedHat/usr/share/licenses/opentabletdriver/LICENSE deleted file mode 100644 index 0a041280b..000000000 --- a/eng/linux/RedHat/usr/share/licenses/opentabletdriver/LICENSE +++ /dev/null @@ -1,165 +0,0 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - - This version of the GNU Lesser General Public License incorporates -the terms and conditions of version 3 of the GNU General Public -License, supplemented by the additional permissions listed below. - - 0. Additional Definitions. - - As used herein, "this License" refers to version 3 of the GNU Lesser -General Public License, and the "GNU GPL" refers to version 3 of the GNU -General Public License. - - "The Library" refers to a covered work governed by this License, -other than an Application or a Combined Work as defined below. - - An "Application" is any work that makes use of an interface provided -by the Library, but which is not otherwise based on the Library. -Defining a subclass of a class defined by the Library is deemed a mode -of using an interface provided by the Library. - - A "Combined Work" is a work produced by combining or linking an -Application with the Library. The particular version of the Library -with which the Combined Work was made is also called the "Linked -Version". - - The "Minimal Corresponding Source" for a Combined Work means the -Corresponding Source for the Combined Work, excluding any source code -for portions of the Combined Work that, considered in isolation, are -based on the Application, and not on the Linked Version. - - The "Corresponding Application Code" for a Combined Work means the -object code and/or source code for the Application, including any data -and utility programs needed for reproducing the Combined Work from the -Application, but excluding the System Libraries of the Combined Work. - - 1. Exception to Section 3 of the GNU GPL. - - You may convey a covered work under sections 3 and 4 of this License -without being bound by section 3 of the GNU GPL. - - 2. Conveying Modified Versions. - - If you modify a copy of the Library, and, in your modifications, a -facility refers to a function or data to be supplied by an Application -that uses the facility (other than as an argument passed when the -facility is invoked), then you may convey a copy of the modified -version: - - a) under this License, provided that you make a good faith effort to - ensure that, in the event an Application does not supply the - function or data, the facility still operates, and performs - whatever part of its purpose remains meaningful, or - - b) under the GNU GPL, with none of the additional permissions of - this License applicable to that copy. - - 3. Object Code Incorporating Material from Library Header Files. - - The object code form of an Application may incorporate material from -a header file that is part of the Library. You may convey such object -code under terms of your choice, provided that, if the incorporated -material is not limited to numerical parameters, data structure -layouts and accessors, or small macros, inline functions and templates -(ten or fewer lines in length), you do both of the following: - - a) Give prominent notice with each copy of the object code that the - Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the object code with a copy of the GNU GPL and this license - document. - - 4. Combined Works. - - You may convey a Combined Work under terms of your choice that, -taken together, effectively do not restrict modification of the -portions of the Library contained in the Combined Work and reverse -engineering for debugging such modifications, if you also do each of -the following: - - a) Give prominent notice with each copy of the Combined Work that - the Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the Combined Work with a copy of the GNU GPL and this license - document. - - c) For a Combined Work that displays copyright notices during - execution, include the copyright notice for the Library among - these notices, as well as a reference directing the user to the - copies of the GNU GPL and this license document. - - d) Do one of the following: - - 0) Convey the Minimal Corresponding Source under the terms of this - License, and the Corresponding Application Code in a form - suitable for, and under terms that permit, the user to - recombine or relink the Application with a modified version of - the Linked Version to produce a modified Combined Work, in the - manner specified by section 6 of the GNU GPL for conveying - Corresponding Source. - - 1) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (a) uses at run time - a copy of the Library already present on the user's computer - system, and (b) will operate properly with a modified version - of the Library that is interface-compatible with the Linked - Version. - - e) Provide Installation Information, but only if you would otherwise - be required to provide such information under section 6 of the - GNU GPL, and only to the extent that such information is - necessary to install and execute a modified version of the - Combined Work produced by recombining or relinking the - Application with a modified version of the Linked Version. (If - you use option 4d0, the Installation Information must accompany - the Minimal Corresponding Source and Corresponding Application - Code. If you use option 4d1, you must provide the Installation - Information in the manner specified by section 6 of the GNU GPL - for conveying Corresponding Source.) - - 5. Combined Libraries. - - You may place library facilities that are a work based on the -Library side by side in a single library together with other library -facilities that are not Applications and are not covered by this -License, and convey such a combined library under terms of your -choice, if you do both of the following: - - a) Accompany the combined library with a copy of the same work based - on the Library, uncombined with any other library facilities, - conveyed under the terms of this License. - - b) Give prominent notice with the combined library that part of it - is a work based on the Library, and explaining where to find the - accompanying uncombined form of the same work. - - 6. Revised Versions of the GNU Lesser General Public License. - - The Free Software Foundation may publish revised and/or new versions -of the GNU Lesser General Public License from time to time. Such new -versions will be similar in spirit to the present version, but may -differ in detail to address new problems or concerns. - - Each version is given a distinguishing version number. If the -Library as you received it specifies that a certain numbered version -of the GNU Lesser General Public License "or any later version" -applies to it, you have the option of following the terms and -conditions either of that published version or of any later version -published by the Free Software Foundation. If the Library as you -received it does not specify a version number of the GNU Lesser -General Public License, you may choose any version of the GNU Lesser -General Public License ever published by the Free Software Foundation. - - If the Library as you received it specifies that a proxy can decide -whether future versions of the GNU Lesser General Public License shall -apply, that proxy's public statement of acceptance of any version is -permanent authorization for you to choose that version for the -Library. diff --git a/eng/linux/lib.sh b/eng/linux/lib.sh index dc8c47aa4..0b17bbac7 100755 --- a/eng/linux/lib.sh +++ b/eng/linux/lib.sh @@ -82,11 +82,11 @@ generate_desktop_file() { mkdir -p "$(dirname "${output}")" cat << EOF > "${output}" [Desktop Entry] -Version=${OTD_VERSION} +Version=1.0 Name=${OTD_NAME} Comment=A ${OTD_DESC} Exec=${OTD_GUI} -Icon=/usr/share/pixmaps/otd.png +Icon=otd Terminal=false Type=Application Categories=Settings; @@ -103,18 +103,12 @@ copy_pixmap_assets() { } create_source_tarball() { - local output="${1}" - output="$(readlink -f "${output}")" - local tmp_dir="$(mktemp -d)" local last_pwd="${PWD}" - local output_file_name="$(basename "${output}")" - output_file_name="${output_file_name%.tar.gz}" + local output_file_name="${1}" local source_tmp_dir="${tmp_dir}/${output_file_name}" - echo "Creating source tarball..." - mkdir -p "${source_tmp_dir}" cd "${tmp_dir}" @@ -157,11 +151,7 @@ create_source_tarball() { find "${source_tmp_dir}" -type d \( -name "bin" -o -name "obj" \) -exec rm -rf {} + - if [ -f "${output}" ]; then - rm "${output}" - fi - - tar -czf "${output}" "${output_file_name}" + tar -cf - "${output_file_name}" cd "${last_pwd}" rm -rf "${tmp_dir}" diff --git a/eng/linux/package.sh b/eng/linux/package.sh index de2d43432..867cbec16 100755 --- a/eng/linux/package.sh +++ b/eng/linux/package.sh @@ -12,6 +12,7 @@ packageGen="" isPortable="false" singleFile="true" selfContained="false" +generateRules="true" print_help() { echo "Usage: ${BASH_SOURCE[0]} [OPTIONS]..." @@ -26,6 +27,7 @@ print_help() { echo " --portable Whether to build portable binaries (default: false)" echo " --single-file Whether to build single-file binaries (default: true)" echo " --self-contained Whether to build self-contained binaries, implies --single-file (default: false)" + echo " --generate-rules Whether to generate udev rules in output (default: true)" echo " -h, --help Print this help message" echo echo "Remarks:" @@ -112,6 +114,10 @@ while [ $# -gt 0 ]; do selfContained="$2" shift ;; + --generate-rules) + generateRules="$2" + shift + ;; --) is_extra_args=true ;; @@ -192,6 +198,11 @@ fi mkdir -p "${output}" +# Will be built in its packaging scripts +if [ -n "${packageGen}" ] && [ "${packageGen}" != "BinaryTarBall" ]; then + build="false" +fi + if [ "${build}" = "true" ]; then echo "Restoring packages..." dotnet restore --verbosity quiet > /dev/null @@ -208,6 +219,10 @@ if [ "${build}" = "true" ]; then dotnet publish "${project}" "${options[@]}" done + if [ "${generateRules}" = "true" ]; then + generate_rules "${output}/99-opentabletdriver.rules" + fi + echo -e "\nBuild finished! Binaries created in ${output}\n" fi