makedeb


kate-root 23.04.2-1


Advanced Text Editor, patched to be able to run as root

Viewing /PKGBUILD.

View raw.

Click here to go back to the Git tree for kate-root.

# Maintainer: huakim-tyk <zuhhaga@gmail.com>

pkgbase=kate-root

_pkgname='kate'
_kate='kate-root'
_kwrite='kwrite-root'
_kate_data='kate5-data'

pkgname=(
"${_kate}"
"${_kwrite}"
"${_kate_data}"
)


shopt -sq expand_aliases
for i in _kate _kwrite _kate_data; do
    alias "_pkg${i}=package_${!i}"
done

pkgver=23.04.2
pkgrel=1
arch=(any)
license=(GPL LGPL FDL)
pkgdesc='Advanced Text Editor, patched to be able to run as root'
groups=(kde-applications kde-utilities)
url='https://apps.kde.org/kate/'

target_multiarch="${DEB_TARGET_MULTIARCH:-$(dpkg-architecture -q DEB_TARGET_MULTIARCH)}"

depends=()

pkgver(){
    cd "${srcdir}/${_pkgname}"
    ver="$(git describe --tags $(git rev-list --tags --max-count=1))"
    echo "${ver:1}"
}

makedepends=(
'cmake'
'shlibdeps-resolve'
'extra-cmake-modules'
'gettext'
'qtbase5-dev'
'libqt5x11extras5-dev'
'kuserfeedback-dev'
'libkf5activities-dev'
'libkf5bookmarks-dev'
'libkf5config-dev'
'libkf5crash-dev'
'libkf5dbusaddons-dev'
'libkf5doctools-dev'
'libkf5guiaddons-dev'
'libkf5i18n-dev'
'libkf5iconthemes-dev'
'libkf5itemmodels-dev'
'libkf5jobwidgets-dev'
'libkf5kio-dev'
'libkf5newstuff-dev'
'libkf5parts-dev'
'libkf5plasma-dev'
'libkf5service-dev'
'libkf5syntaxhighlighting-dev'
'libkf5texteditor-dev'
'libkf5textwidgets-dev'
'libkf5threadweaver-dev'
'libkf5wallet-dev'
'libkf5windowsystem-dev'
'libkf5xmlgui-dev'
'pkg-config'
'qtbase5-dev'
)
replaces=('kwrite')
source=(git+https://github.com/KDE/kate.git
        '0001-Defuse-root-block.patch')
sha512sums=('SKIP'
            '2746764e64a17e657a646c045577ec62939ad49611e00e96a0a8873bd0bd296f941fb521e680061af4b6a56eee18be945f6ad843d52f13e2d9ba4ccb880f38d2')

prepare() {
  # root shall be allowed once again
  patch -d "${srcdir}/${_pkgname}" -Np1 -t -i "${srcdir}/0001-Defuse-root-block.patch" || :
}


build() {
  cmake -B build -S $_pkgname \
    -DBUILD_TESTING=OFF \
    -DCMAKE_INSTALL_PREFIX="${srcdir}/library/usr"
  cd build
  cmake --build .
  make install
  
  cd "${srcdir}/library/usr/lib/${target_multiarch}/"
  ln -sfT . qt5
}

list_install(){
    echo "$1" | globexec "${srcdir}/library" "${pkgdir}" 'ln -v' 'mkdir -pv'
}

shlibs='depends+=($(shlibdeps-resolve -b "${pkgdir}" -r "${srcdir}/library" ))'


_pkg_kate() {
list_install "usr/bin/kate
usr/lib/*/libkateprivate.so.*
usr/lib/*/qt5/plugins/ktexteditor/
usr/share/applications/org.kde.kate.desktop
usr/share/metainfo/org.kde.kate.appdata.xml" 
eval "$shlibs"
depends+=("${_kate_data}>=${pkgver}-${pkgrel}")

conflicts=('kate')
provides=('kate') 

}


_pkg_kwrite() {
list_install "usr/bin/kwrite
usr/share/applications/org.kde.kwrite.desktop
usr/share/doc/HTML/*/kwrite/
usr/share/icons/hicolor/*/apps/kwrite.png
usr/share/metainfo/org.kde.kwrite.appdata.xml"
eval "$shlibs"
depends+=("${_kate}>=${pkgver}-${pkgrel}")

 
conflicts=('kwrite')
provides=('kwrite') 

}

_pkg_kate_data() {
list_install "usr/share/doc/HTML/*/kate/
usr/share/doc/HTML/*/katepart/
usr/share/icons/hicolor/*/apps/kate.png
usr/share/icons/hicolor/scalable/apps/kate.svg
usr/share/icons/hicolor/scalable/apps/kwrite.svg
usr/share/kateproject/kateproject.example
usr/share/katexmltools/
usr/share/kconf_update/
usr/share/locale/*/LC_MESSAGES/*kate*.mo
usr/share/locale/*/LC_MESSAGES/ktexteditorpreviewplugin.mo
usr/share/locale/*/LC_MESSAGES/lspclient.mo
usr/share/locale/*/LC_MESSAGES/tabswitcherplugin.mo
#usr/share/man/*/man1/kate.1
usr/share/man/man1/kate.1"
pkgarch='all'
}