Skip to content

Commit

Permalink
feat: add gprename
Browse files Browse the repository at this point in the history
gprename: complete batch renamer for Linux

Log: add  gprename
Issue:
deepin-community/sig-deepin-sysdev-team#374
  • Loading branch information
liushanyang12138 committed Jul 12, 2023
1 parent dc6b26e commit 832e246
Show file tree
Hide file tree
Showing 40 changed files with 6,466 additions and 28 deletions.
621 changes: 621 additions & 0 deletions COPYING.TXT

Large diffs are not rendered by default.

121 changes: 121 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
# Makefile for GPRename
# Author: Marvin Stark <[email protected]>
# Copyright (C) 2007 [email protected]

# Globals:
PREFIX=/usr/local
DESTDIR=/usr/local

build:
# Create temporary build directory and modify file locations.
install -d "$(CURDIR)/build"
install -d "$(CURDIR)/build/locale"
install -d "$(CURDIR)/build/locale/ca"
install -d "$(CURDIR)/build/locale/de"
install -d "$(CURDIR)/build/locale/es"
install -d "$(CURDIR)/build/locale/et"
install -d "$(CURDIR)/build/locale/fr"
install -d "$(CURDIR)/build/locale/id"
install -d "$(CURDIR)/build/locale/it"
install -d "$(CURDIR)/build/locale/nl"
install -d "$(CURDIR)/build/locale/pl"
install -d "$(CURDIR)/build/locale/pt_BR"
install -d "$(CURDIR)/build/locale/ro"
install -d "$(CURDIR)/build/locale/ru"
install -d "$(CURDIR)/build/locale/sv"
install -d "$(CURDIR)/build/locale/zh_CN"
perl -ne 's!\@INSTALLDIR\@!$(PREFIX)!g ; print' < bin/gprename > build/gprename
perl -ne 's!\@INSTALLDIR\@!$(PREFIX)!g ; print' < bin/gprename.desktop > build/gprename.desktop

install: uninstall build
# Compile all .po files to .mo
msgfmt -o build/locale/ca.mo locale/ca.po
msgfmt -o build/locale/de.mo locale/de.po
msgfmt -o build/locale/es.mo locale/es.po
msgfmt -o build/locale/et.mo locale/et.po
msgfmt -o build/locale/fr.mo locale/fr.po
msgfmt -o build/locale/id.mo locale/id.po
msgfmt -o build/locale/it.mo locale/it.po
msgfmt -o build/locale/nl.mo locale/nl.po
msgfmt -o build/locale/pl.mo locale/pl.po
msgfmt -o build/locale/pt_BR.mo locale/pt_BR.po
msgfmt -o build/locale/ro.mo locale/ro.po
msgfmt -o build/locale/ru.mo locale/ru.po
msgfmt -o build/locale/sv.mo locale/sv.po
msgfmt -o build/locale/zh_CN.mo locale/zh_CN.po

# Create directories
install -d "$(DESTDIR)"
install -d "$(DESTDIR)/bin"
install -d "/usr/share"
install -d "/usr/share/icons"
install -d "$(DESTDIR)/share/applications"
install -d "$(DESTDIR)/share/man"
install -d "$(DESTDIR)/share/man/man1"
install -d "$(DESTDIR)/share/locale/ca/LC_MESSAGES"
install -d "$(DESTDIR)/share/locale/de/LC_MESSAGES"
install -d "$(DESTDIR)/share/locale/es/LC_MESSAGES"
install -d "$(DESTDIR)/share/locale/et/LC_MESSAGES"
install -d "$(DESTDIR)/share/locale/fr/LC_MESSAGES"
install -d "$(DESTDIR)/share/locale/id/LC_MESSAGES"
install -d "$(DESTDIR)/share/locale/it/LC_MESSAGES"
install -d "$(DESTDIR)/share/locale/nl/LC_MESSAGES"
install -d "$(DESTDIR)/share/locale/pl/LC_MESSAGES"
install -d "$(DESTDIR)/share/locale/pt_BR/LC_MESSAGES"
install -d "$(DESTDIR)/share/locale/ro/LC_MESSAGES"
install -d "$(DESTDIR)/share/locale/ru/LC_MESSAGES"
install -d "$(DESTDIR)/share/locale/sv/LC_MESSAGES"
install -d "$(DESTDIR)/share/locale/zh_CN/LC_MESSAGES"

# Copy all files in the filesystem
install -m 755 build/gprename "$(DESTDIR)/bin/"
install -m 644 gprename-nautilus-actions.xml "$(DESTDIR)/share/applications/"
install -m 644 icon/gprename.png "/usr/share/icons/"
install -m 644 man/gprename.1 "$(DESTDIR)/share/man/man1/"
install -m 644 build/locale/ca.mo "$(DESTDIR)/share/locale/ca/LC_MESSAGES/gprename.mo"
install -m 644 build/locale/de.mo "$(DESTDIR)/share/locale/de/LC_MESSAGES/gprename.mo"
install -m 644 build/locale/es.mo "$(DESTDIR)/share/locale/es/LC_MESSAGES/gprename.mo"
install -m 644 build/locale/et.mo "$(DESTDIR)/share/locale/et/LC_MESSAGES/gprename.mo"
install -m 644 build/locale/fr.mo "$(DESTDIR)/share/locale/fr/LC_MESSAGES/gprename.mo"
install -m 644 build/locale/id.mo "$(DESTDIR)/share/locale/id/LC_MESSAGES/gprename.mo"
install -m 644 build/locale/it.mo "$(DESTDIR)/share/locale/it/LC_MESSAGES/gprename.mo"
install -m 644 build/locale/nl.mo "$(DESTDIR)/share/locale/nl/LC_MESSAGES/gprename.mo"
install -m 644 build/locale/pl.mo "$(DESTDIR)/share/locale/pl/LC_MESSAGES/gprename.mo"
install -m 644 build/locale/pt_BR.mo "$(DESTDIR)/share/locale/pt_BR/LC_MESSAGES/gprename.mo"
install -m 644 build/locale/ro.mo "$(DESTDIR)/share/locale/ro/LC_MESSAGES/gprename.mo"
install -m 644 build/locale/ru.mo "$(DESTDIR)/share/locale/ru/LC_MESSAGES/gprename.mo"
install -m 644 build/locale/sv.mo "$(DESTDIR)/share/locale/sv/LC_MESSAGES/gprename.mo"
install -m 644 build/locale/zh_CN.mo "$(DESTDIR)/share/locale/zh_CN/LC_MESSAGES/gprename.mo"
desktop-file-install bin/gprename.desktop
update-desktop-database
@echo "Installation completed."

uninstall: clean
rm -f "$(DESTDIR)/bin/gprename"
rm -f "/usr/share/applications/gprename.desktop"
rm -f "$(DESTDIR)/share/applications/gprename-nautilus-actions.xml"
rm -f "$(DESTDIR)/share/man/man1/gprename.1"
rm -f "$(DESTDIR)/share/locale/ca/LC_MESSAGES/gprename.mo"
rm -f "$(DESTDIR)/share/locale/de/LC_MESSAGES/gprename.mo"
rm -f "$(DESTDIR)/share/locale/es/LC_MESSAGES/gprename.mo"
rm -f "$(DESTDIR)/share/locale/et/LC_MESSAGES/gprename.mo"
rm -f "$(DESTDIR)/share/locale/fr/LC_MESSAGES/gprename.mo"
rm -f "$(DESTDIR)/share/locale/id/LC_MESSAGES/gprename.mo"
rm -f "$(DESTDIR)/share/locale/it/LC_MESSAGES/gprename.mo"
rm -f "$(DESTDIR)/share/locale/nl/LC_MESSAGES/gprename.mo"
rm -f "$(DESTDIR)/share/locale/pl/LC_MESSAGES/gprename.mo"
rm -f "$(DESTDIR)/share/locale/pt_BR/LC_MESSAGES/gprename.mo"
rm -f "$(DESTDIR)/share/locale/ro/LC_MESSAGES/gprename.mo"
rm -f "$(DESTDIR)/share/locale/ru/LC_MESSAGES/gprename.mo"
rm -f "$(DESTDIR)/share/locale/sv/LC_MESSAGES/gprename.mo"
rm -f "$(DESTDIR)/share/locale/zh_CN/LC_MESSAGES/gprename.mo"
rm -fr "/usr/share/icons/gprename"
update-desktop-database

clean:
rm -rf build

help:
@echo "Type \"make install\" to install GPRename."
@echo "Type \"make uninstall\" to remove GPRename."
@echo "Type \"make clean\" to clean the current directory."
Loading

0 comments on commit 832e246

Please sign in to comment.