Browse Source

Default install method is now the zippy way. Added uninstall rule.

sisyphus
JezerM 3 years ago
parent
commit
4af692677a
No known key found for this signature in database
GPG Key ID: 66BBC5D01388C6B5
  1. 9
      Makefile
  2. 6
      README.md
  3. 60
      build/utils.sh

9
Makefile

@ -64,8 +64,8 @@ build: _build_init _apply_config
$(DO) build $(PREFIX)
$(DO) prepare-install $(PREFIX)
build_old: _build_init _apply_config
$(DO) build_old $(PREFIX)
build_freeze: _build_init _apply_config
$(DO) build_freeze $(PREFIX)
$(DO) prepare-install $(PREFIX)
build_dev: build
@ -78,9 +78,12 @@ install: build
$(MAYBE_SUDO_DO) install $(DESTDIR) $(PREFIX)
$(call colorecho, SUCCESS!)
install_old: build_old
install_freeze: build_freeze
$(MAYBE_SUDO_DO) install $(DESTDIR) $(PREFIX)
$(call colorecho, SUCCESS!)
uninstall:
$(MAYBE_SUDO_DO) uninstall $(DESTDIR) $(PREFIX)
.PHONY: all _apply_config _build_init build build_dev clean install

6
README.md

@ -35,7 +35,7 @@ Gruvbox and Dracula themes!
- PyQtWebEngine
- ruamel.yaml
- python-xlib
- [cx_freeze](https://cx-freeze.readthedocs.io/en/latest/installation.html) (and patchelf)
- [cx_freeze](https://cx-freeze.readthedocs.io/en/latest/installation.html) (and patchelf) (Optional)
Install PIP dependencies with:
```sh
@ -52,12 +52,12 @@ sudo pip install -r requirements.txt
sudo make install
```
This will build and install **web-greeter** with [cx_freeze][cx_freeze]. Either `sudo make install_old`, which will use the old zippy way to install **web-greeter**; it's strongly recommended to not use the last one, as it depends on the actual python interpreter and its libraries. Update python or delete a library, and **web-greeter** won't work.
Whis will build and install **web-greeter** in a zippy way, which compresses the python code as a zip and uses it as a binary. Either `sudo make install_freeze` to build and install with cx_freeze. The zippy method depends on the actual python interpreter and its libraries, so you could have problems when updating python or removing any dependency, while the cx_freeze method tries to fix this "problem".
See [latest release][releases].
## Theme JavaScript API
[Antergos][Antergos] documentation is no longer available, although it is accesible through [Web Archive][WebArchive]. Actual documentation is available in [gh-pages][gh-pages].
[Antergos][Antergos] documentation is no longer available, although it is accesible through [Web Archive][WebArchive]. Current and updated documentation is available at [gh-pages][gh-pages].
You can access the man-pages `man web-greeter` for some documentation and explanation. Also, you can explore the provided [themes](./themes) for real use cases.

60
build/utils.sh

@ -8,7 +8,8 @@ DESTDIR=''
PREFIX=''
clean_build_dir() {
find "${BUILD_DIR}" -type f ! -path '**/ci/**' ! -name '*.yml' ! -path "**/DEBIAN/**" ! -name utils.sh -delete
find "${BUILD_DIR}" -type f ! -path '**/ci/**' ! -name '*.yml' ! -path "**/DEBIAN/**" ! -name \
utils.sh ! -name setup_log -delete
find "${BUILD_DIR}" -type d ! -name build ! -path '**/ci' -delete 2>/dev/null || true
}
@ -18,7 +19,7 @@ combine_javascript_sources() {
bootstrap.js > bundle.js
}
do_old_build() {
do_build() {
cd "${BUILD_DIR}"
# Compile Resources
@ -36,7 +37,7 @@ do_old_build() {
&& chmod +x "${INSTALL_ROOT}${PREFIX}/bin/web-greeter")
}
do_build() {
do_build_freeze() {
cd "${BUILD_DIR}"
echo "Building web-greeter with cx_freeze..."
@ -50,7 +51,7 @@ do_build() {
do_install() {
[[ -e "${DESTDIR}" ]] || mkdir -p "${DESTDIR}"
cp -R "${INSTALL_ROOT}"/* "${DESTDIR}"
ln -sf "${DESTDIR}"/opt/web-greeter/web-greeter "${DESTDIR}"/usr/bin/web-greeter
[[ -e "${DESTDIR}"/opt/web-greeter ]] && ln -sf "${DESTDIR}"/opt/web-greeter/web-greeter ${DESTDIR}${PREFIX}/bin/web-greeter
}
init_build_dir() {
@ -121,6 +122,47 @@ prepare_install() {
fi
}
do_uninstall() {
# Man Page
rm -f ${DESTDIR}${PREFIX}/share/man/man1/web-greeter.1
# Command line completions
if [[ -f /usr/bin/bash ]]; then
rm -f ${DESTDIR}${PREFIX}/share/bash-completion/completions/${PKGNAME}
fi
if [[ -f /usr/bin/zsh ]]; then
rm -f ${DESTDIR}${PREFIX}/share/zsh/vendor-completions/_${PKGNAME}
fi
# Greeter Config
#rm ${DESTDIR}/etc/lightdm/${PKGNAME}.yml
# Themes
#rm -rf ${DESTDIR}${PREFIX}/share/web-greeter
# AppData File
rm -f ${DESTDIR}${PREFIX}/share/metainfo/${PKGNAME}.appdata.xml
# Greeter desktop file
rm -f ${DESTDIR}${PREFIX}/share/xgreeters/web-greeter.desktop
# Application desktop file
rm -f ${DESTDIR}${PREFIX}/share/applications/web-greeter.desktop
# XGreeter wrapper
rm -f ${DESTDIR}/etc/xdg/lightdm/lightdm.conf.d/90-greeter-wrapper.conf
rm -f ${DESTDIR}/etc/lightdm/Xgreeter
# Binary
rm -f ${DESTDIR}${PREFIX}/bin/web-greeter
[[ -e "${DESTDIR}"/opt/web-greeter ]] && rm -rf ${DESTDIR}/opt/web-greeter
echo "Themes are not uninstalled. Remove them manually:
${DESTDIR}${PREFIX}/share/web-greeter/"
echo "web-greeter config was not uninstalled. Remove it manually:
${DESTDIR}/etc/lightdm/${PKGNAME}.yml"
}
set_config() {
[[ -z "$1" || -z "$2" ]] && return 1
@ -146,9 +188,9 @@ case "$1" in
do_build
;;
build_old)
build_freeze)
PREFIX="$2"
do_old_build
do_build_freeze
;;
build-init)
@ -171,6 +213,12 @@ case "$1" in
prepare_install
;;
uninstall)
DESTDIR="$2"
PREFIX="$3"
do_uninstall
;;
set-config)
set_config "$2" "$3"
;;

Loading…
Cancel
Save