Commit 7f9fa714 authored by Rémi BERTHO's avatar Rémi BERTHO

Improve utility.sh

parent cac0fcc4
No preview for this file type
No preview for this file type
......@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-11-01 11:03+0100\n"
"POT-Creation-Date: 2017-11-01 14:30+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
......
This diff is collapsed.
This diff is collapsed.
......@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-11-01 11:03+0100\n"
"POT-Creation-Date: 2017-11-01 14:30+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
......
......@@ -35,35 +35,35 @@ print_help()
update_man()
{
echo "Update man pages"
cd "$dir/Man"
cd "Man" || return
pandoc -s -t man csuper-cli.1.md -o csuper-cli.1
gzip -f csuper-cli.1
pandoc -s -t man csuper-gtk.1.md -o csuper-gtk.1
gzip -f csuper-gtk.1
cd "$dir"
cd .. || return
}
update_translation()
{
echo "Update translations"
xgettext --sort-by-file --add-comments=TRANSLATORS: --keyword=_ -o $dir/Translations/libcsuper/messages.pot Sources/libcsuper/*.cpp
xgettext --sort-by-file --add-comments=TRANSLATORS: --keyword=_ -o $dir/Translations/csuper-cli/messages.pot Sources/csuper-cli/*.cpp
xgettext --sort-by-file --add-comments=TRANSLATORS: --keyword=translatable --keyword=_ -o $dir/Translations/csuper-gtk/messages.pot $dir/Sources/csuper-gtk/*.cpp $dir/UI/csuper-gtk.glade
xgettext --sort-by-file --add-comments=TRANSLATORS: --keyword=_ -o Translations/libcsuper/messages.pot Sources/libcsuper/*.cpp
xgettext --sort-by-file --add-comments=TRANSLATORS: --keyword=_ -o Translations/csuper-cli/messages.pot Sources/csuper-cli/*.cpp
xgettext --sort-by-file --add-comments=TRANSLATORS: --keyword=translatable --keyword=_ -o Translations/csuper-gtk/messages.pot Sources/csuper-gtk/*.cpp UI/csuper-gtk.glade
for i in "$dir/Translations/libcsuper/*.po"
for i in Translations/libcsuper/*.po
do
msgmerge -U $i "$dir/Translations/libcsuper/messages.pot"
msgmerge -U $i "Translations/libcsuper/messages.pot"
done
for i in "$dir/Translations/csuper-cli/*.po"
for i in Translations/csuper-cli/*.po
do
msgmerge -U $i "$dir/Translations/csuper-cli/messages.pot"
msgmerge -U $i "Translations/csuper-cli/messages.pot"
done
for i in "$dir/Translations/csuper-gtk/*.po"
for i in Translations/csuper-gtk/*.po
do
msgmerge -U $i "$dir/Translations/csuper-gtk/messages.pot"
msgmerge -U $i "Translations/csuper-gtk/messages.pot"
done
}
......@@ -71,59 +71,59 @@ compile_translation()
{
echo "Compile translations"
mkdir -p Locales/fr_FR/LC_MESSAGES
msgfmt "$dir/Translations/libcsuper/fr.po" -o "$dir/Locales/fr_FR/LC_MESSAGES/libcsuper.mo"
msgfmt "$dir/Translations/csuper-cli/fr.po" -o "$dir/Locales/fr_FR/LC_MESSAGES/csuper-cli.mo"
msgfmt "$dir/Translations/csuper-gtk/fr.po" -o "$dir/Locales/fr_FR/LC_MESSAGES/csuper-gtk.mo"
msgfmt "Translations/libcsuper/fr.po" -o "Locales/fr_FR/LC_MESSAGES/libcsuper.mo"
msgfmt "Translations/csuper-cli/fr.po" -o "Locales/fr_FR/LC_MESSAGES/csuper-cli.mo"
msgfmt "Translations/csuper-gtk/fr.po" -o "Locales/fr_FR/LC_MESSAGES/csuper-gtk.mo"
}
generate_documentation()
{
echo "Generate documentation"
cd "$dir/Documentation"
cd "Documentation" || return
doxygen libcsuper_doxyfile &> /dev/null
doxygen csuper-cli_doxyfile &> /dev/null
doxygen csuper-gtk_doxyfile &> /dev/null
cd "$dir"
cd .. || return
}
compile_pdf_doc()
{
echo "Compile PDF documentation"
cd "$dir/Documentation/libcsuper/latex"
cd "Documentation/libcsuper/latex" || return
make &> /dev/null
cd ../../csuper-cli/latex
cd ../../csuper-cli/latex || return
make &> /dev/null
cd ../../csuper-gtk/latex
cd ../../csuper-gtk/latex || return
make &> /dev/null
cd "$dir"
cd ../../.. || return
}
format_code()
{
echo "Format code"
clang-format -style=file $dir/Sources/libcsuper/*.cpp -i
clang-format -style=file $dir/Sources/libcsuper/*.h -i
clang-format -style=file $dir/Sources/csuper-cli/*.cpp -i
clang-format -style=file $dir/Sources/csuper-cli/*.h -i
clang-format -style=file $dir/Sources/csuper-gtk/*.cpp -i
clang-format -style=file $dir/Sources/csuper-gtk/*.h -i
clang-format -style=file Sources/libcsuper/*.cpp -i
clang-format -style=file Sources/libcsuper/*.h -i
clang-format -style=file Sources/csuper-cli/*.cpp -i
clang-format -style=file Sources/csuper-cli/*.h -i
clang-format -style=file Sources/csuper-gtk/*.cpp -i
clang-format -style=file Sources/csuper-gtk/*.h -i
}
install_libcsuper()
{
echo "Install libcsuper"
sudo mkdir -p /usr/share/csuper/Locales/fr_FR/LC_MESSAGES
sudo cp $dir/libcsuper.so /usr/lib
sudo cp $dir/Locales/fr_FR/LC_MESSAGES/libcsuper.mo /usr/share/csuper/Locales/fr_FR/LC_MESSAGES/libcsuper.mo
sudo cp libcsuper.so /usr/lib
sudo cp Locales/fr_FR/LC_MESSAGES/libcsuper.mo /usr/share/csuper/Locales/fr_FR/LC_MESSAGES/libcsuper.mo
sudo mkdir -p /usr/include/libcsuper
sudo cp $dir/Sources/libcsuper/*.h /usr/include/libcsuper
sudo cp -R $dir/Images /usr/share/csuper
sudo cp Sources/libcsuper/*.h /usr/include/libcsuper
sudo cp -R Images /usr/share/csuper
sudo update-mime-database usr/share/mime &> /dev/null
sudo cp $dir/Installation/Mime/csuper.xml /usr/share/mime/packages/
sudo cp $dir/Installation/Mime/application-csu.png /usr/share/icons/hicolor/48x48/mimetypes
sudo cp Installation/Mime/csuper.xml /usr/share/mime/packages/
sudo cp Installation/Mime/application-csu.png /usr/share/icons/hicolor/48x48/mimetypes
sudo ldconfig
}
......@@ -131,10 +131,10 @@ install_csuper_cli()
{
echo "Install csuper-cli"
sudo mkdir -p /usr/share/csuper/Locales/fr_FR/LC_MESSAGES
sudo cp $dir/csuper-cli /usr/share/csuper
sudo cp -R $dir/Locales/fr_FR/LC_MESSAGES/csuper-cli.mo /usr/share/csuper/Locales/fr_FR/LC_MESSAGES
sudo cp $dir/Installation/csuper-cli /usr/bin/csuper-cli
sudo cp $dir/Man/csuper-cli.1.gz /usr/share/man/man1
sudo cp csuper-cli /usr/share/csuper
sudo cp -R Locales/fr_FR/LC_MESSAGES/csuper-cli.mo /usr/share/csuper/Locales/fr_FR/LC_MESSAGES
sudo cp Installation/csuper-cli /usr/bin/csuper-cli
sudo cp Man/csuper-cli.1.gz /usr/share/man/man1
sudo chmod -R a+rx /usr/share/csuper
}
......@@ -142,16 +142,16 @@ install_csuper_gtk()
{
echo "Install csuper-gtk"
sudo mkdir -p /usr/share/csuper/Locales/fr_FR/LC_MESSAGES
sudo cp $dir/csuper-gtk /usr/share/csuper
sudo cp -R $dir/UI /usr/share/csuper
sudo cp -R $dir/Locales/fr_FR/LC_MESSAGES/csuper-gtk.mo /usr/share/csuper/Locales/fr_FR/LC_MESSAGES
sudo cp $dir/Installation/csuper-gtk /usr/bin/csuper-gtk
sudo cp $dir/Installation/csuper-html /usr/bin/csuper-html
sudo cp $dir/Installation/csuper-html-autostart /usr/bin/csuper-html-autostart
sudo cp $dir/Man/csuper-gtk.1.gz /usr/share/man/man1
sudo cp $dir/Installation/fr.dalan.csuper-gtk.desktop /usr/share/applications/
sudo cp $dir/Installation/fr.dalan.csuper-html.desktop /usr/share/applications/
sudo cp $dir/Installation/csuper.service /etc/systemd/system/
sudo cp csuper-gtk /usr/share/csuper
sudo cp -R UI /usr/share/csuper
sudo cp -R Locales/fr_FR/LC_MESSAGES/csuper-gtk.mo /usr/share/csuper/Locales/fr_FR/LC_MESSAGES
sudo cp Installation/csuper-gtk /usr/bin/csuper-gtk
sudo cp Installation/csuper-html /usr/bin/csuper-html
sudo cp Installation/csuper-html-autostart /usr/bin/csuper-html-autostart
sudo cp Man/csuper-gtk.1.gz /usr/share/man/man1
sudo cp Installation/fr.dalan.csuper-gtk.desktop /usr/share/applications/
sudo cp Installation/fr.dalan.csuper-html.desktop /usr/share/applications/
sudo cp Installation/csuper.service /etc/systemd/system/
sudo chmod -R a+rx /usr/share/csuper
[[ -x usr/bin/update-desktop-database ]] && update-desktop-database -q || true
}
......@@ -193,11 +193,7 @@ uninstall_csuper_gtk()
sudo rm /etc/systemd/system/csuper.service
}
if [[ $2 == "" ]] ; then
dir=$(pwd)
else
dir=$2
fi
cd "$(dirname "${BASH_SOURCE[0]}")" || exit
case "$1" in
"-h" | "--help")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment