diff --git a/configure b/configure index 50e9144..e8f20eb 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for simple-fb2-reader 1.0.0. +# Generated by GNU Autoconf 2.69 for simple-fb2-reader 1.0.4. # # Report bugs to . # @@ -580,8 +580,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='simple-fb2-reader' PACKAGE_TARNAME='simple-fb2-reader' -PACKAGE_VERSION='1.0.0' -PACKAGE_STRING='simple-fb2-reader 1.0.0' +PACKAGE_VERSION='1.0.4' +PACKAGE_STRING='simple-fb2-reader 1.0.4' PACKAGE_BUGREPORT='medved_cool@mail.ru' PACKAGE_URL='https://github.com/Cactus64k/simple-fb2-reader' @@ -1246,7 +1246,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures simple-fb2-reader 1.0.0 to adapt to many kinds of systems. +\`configure' configures simple-fb2-reader 1.0.4 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1308,7 +1308,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of simple-fb2-reader 1.0.0:";; + short | recursive ) echo "Configuration of simple-fb2-reader 1.0.4:";; esac cat <<\_ACEOF @@ -1402,7 +1402,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -simple-fb2-reader configure 1.0.0 +simple-fb2-reader configure 1.0.4 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1825,7 +1825,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by simple-fb2-reader $as_me 1.0.0, which was +It was created by simple-fb2-reader $as_me 1.0.4, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2175,7 +2175,8 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu # AM_INIT_AUTOMAKE # AC_CONFIG_SRCDIR([src/]) -# AC_CONFIG_HEADERS([src/config.h]) +ac_config_headers="$ac_config_headers src/config.h" + # Checks for programs. ac_ext=c @@ -4242,43 +4243,7 @@ test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' -# Transform confdefs.h into DEFS. -# Protect against shell expansion while executing Makefile rules. -# Protect against Makefile macro expansion. -# -# If the first sed substitution is executed (which looks for macros that -# take arguments), then branch to the quote section. Otherwise, -# look for a macro that doesn't take arguments. -ac_script=' -:mline -/\\$/{ - N - s,\\\n,, - b mline -} -t clear -:clear -s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g -t quote -s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g -t quote -b any -:quote -s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g -s/\[/\\&/g -s/\]/\\&/g -s/\$/$$/g -H -:any -${ - g - s/^\n// - s/\n/ /g - p -} -' -DEFS=`sed -n "$ac_script" confdefs.h` - +DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= @@ -4694,7 +4659,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by simple-fb2-reader $as_me 1.0.0, which was +This file was extended by simple-fb2-reader $as_me 1.0.4, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -4712,11 +4677,15 @@ case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac +case $ac_config_headers in *" +"*) set x $ac_config_headers; shift; ac_config_headers=$*;; +esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" +config_headers="$ac_config_headers" _ACEOF @@ -4737,10 +4706,15 @@ Usage: $0 [OPTION]... [TAG]... --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE Configuration files: $config_files +Configuration headers: +$config_headers + Report bugs to . simple-fb2-reader home page: ." @@ -4748,7 +4722,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -simple-fb2-reader config.status 1.0.0 +simple-fb2-reader config.status 1.0.4 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" @@ -4802,7 +4776,18 @@ do esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; - --he | --h | --help | --hel | -h ) + --header | --heade | --head | --hea ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append CONFIG_HEADERS " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + as_fn_error $? "ambiguous option: \`$1' +Try \`$0 --help' for more information.";; + --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) @@ -4858,6 +4843,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 for ac_config_target in $ac_config_targets do case $ac_config_target in + "src/config.h") CONFIG_HEADERS="$CONFIG_HEADERS src/config.h" ;; "makefile") CONFIG_FILES="$CONFIG_FILES makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; @@ -4871,6 +4857,7 @@ done # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers fi # Have a temporary directory for convenience. Make it in the build tree @@ -5058,8 +5045,116 @@ fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" +# Set up the scripts for CONFIG_HEADERS section. +# No need to generate them if there are no CONFIG_HEADERS. +# This happens for instance with `./config.status Makefile'. +if test -n "$CONFIG_HEADERS"; then +cat >"$ac_tmp/defines.awk" <<\_ACAWK || +BEGIN { +_ACEOF + +# Transform confdefs.h into an awk script `defines.awk', embedded as +# here-document in config.status, that substitutes the proper values into +# config.h.in to produce config.h. + +# Create a delimiter string that does not exist in confdefs.h, to ease +# handling of long lines. +ac_delim='%!_!# ' +for ac_last_try in false false :; do + ac_tt=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_tt"; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +# For the awk script, D is an array of macro values keyed by name, +# likewise P contains macro parameters if any. Preserve backslash +# newline sequences. + +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +sed -n ' +s/.\{148\}/&'"$ac_delim"'/g +t rset +:rset +s/^[ ]*#[ ]*define[ ][ ]*/ / +t def +d +:def +s/\\$// +t bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3"/p +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p +d +:bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3\\\\\\n"\\/p +t cont +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p +t cont +d +:cont +n +s/.\{148\}/&'"$ac_delim"'/g +t clear +:clear +s/\\$// +t bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/"/p +d +:bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p +b cont +' >$CONFIG_STATUS || ac_write_fail=1 -eval set X " :F $CONFIG_FILES " +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + for (key in D) D_is_set[key] = 1 + FS = "" +} +/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { + line = \$ 0 + split(line, arg, " ") + if (arg[1] == "#") { + defundef = arg[2] + mac1 = arg[3] + } else { + defundef = substr(arg[1], 2) + mac1 = arg[2] + } + split(mac1, mac2, "(") #) + macro = mac2[1] + prefix = substr(line, 1, index(line, defundef) - 1) + if (D_is_set[macro]) { + # Preserve the white space surrounding the "#". + print prefix "define", macro P[macro] D[macro] + next + } else { + # Replace #undef with comments. This is necessary, for example, + # in the case of _POSIX_SOURCE, which is predefined and required + # on some systems where configure will not decide to define it. + if (defundef == "undef") { + print "/*", prefix defundef, macro, "*/" + next + } + } +} +{ print } +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 +fi # test -n "$CONFIG_HEADERS" + + +eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS " shift for ac_tag do @@ -5267,7 +5362,64 @@ which seems to be undefined. Please make sure it is defined" >&2;} esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; - + :H) + # + # CONFIG_HEADER + # + if test x"$ac_file" != x-; then + { + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" + } >"$ac_tmp/config.h" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then + { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +$as_echo "$as_me: $ac_file is unchanged" >&6;} + else + rm -f "$ac_file" + mv "$ac_tmp/config.h" "$ac_file" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + fi + else + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ + || as_fn_error $? "could not create -" "$LINENO" 5 + fi +# Compute "$ac_file"'s index in $config_headers. +_am_arg="$ac_file" +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || +$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$_am_arg" : 'X\(//\)[^/]' \| \ + X"$_am_arg" : 'X\(//\)$' \| \ + X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$_am_arg" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'`/stamp-h$_am_stamp_count + ;; esac diff --git a/configure.ac b/configure.ac index f286d57..c743c41 100644 --- a/configure.ac +++ b/configure.ac @@ -5,7 +5,7 @@ AC_PREREQ([2.69]) AC_INIT([simple-fb2-reader], [1.0.4], [medved_cool@mail.ru], [], [https://github.com/Cactus64k/simple-fb2-reader]) # AM_INIT_AUTOMAKE # AC_CONFIG_SRCDIR([src/]) -# AC_CONFIG_HEADERS([src/config.h]) +AC_CONFIG_HEADERS([src/config.h]) # Checks for programs. AC_PROG_CC_C99 @@ -28,5 +28,10 @@ AC_TYPE_SSIZE_T AC_FUNC_REALLOC AC_CHECK_FUNCS([memset setlocale strchr strerror]) +AC_DEFINE_UNQUOTED([GUI_CONSTRUCT_PATH], "${prefix}/share/${PACKAGE_NAME}/${PACKAGE_NAME}.glade") +AC_DEFINE_UNQUOTED([ENCODE_LIST_PATH], "${sysconfdir}/simple-fb2-reader_encoding_list.cfg") +AC_DEFINE_UNQUOTED([PACKAGE_VERSION], "${PACKAGE_VERSION}") + + AC_CONFIG_FILES([makefile]) AC_OUTPUT diff --git a/debian/changelog b/debian/changelog index d94c780..33c9878 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,9 +1,10 @@ -simple-fb2-reader (1.0.4-1) unstable; urgency=low +simple-fb2-reader (1.0.5-1) unstable; urgency=low * Initial release (Closes: #nnnn) * Fix navigaiton chapter content * Refactoring, add in book open dialog "file-activate" handler * Add command line options * Add autotools scripts, more themes options, arrow key scrolling + * Fix autotools scripts -- Cactus Sun, 08 Mar 2015 00:29:56 +0300 diff --git a/debian/control b/debian/control index 89452f9..3b64a91 100644 --- a/debian/control +++ b/debian/control @@ -9,7 +9,6 @@ Homepage: https://github.com/Cactus64k/simple-fb2-reader #Vcs-Browser: http://git.debian.org/?p=collab-maint/simple-fb2-reader.git;a=summary Package: simple-fb2-reader -Version: 1.0.1 Architecture: amd64 Depends: ${shlibs:Depends} Description: Simple tool to read FB2 books. Developed using GTK+3. diff --git a/debian/dirs b/debian/dirs deleted file mode 100644 index 0210b5a..0000000 --- a/debian/dirs +++ /dev/null @@ -1,10 +0,0 @@ -/etc/ -/usr/bin/ -/usr/share/applications/ -/usr/share/icons/hicolor/scalable/apps/ -/usr/share/icons/hicolor/scalable/mimetypes/ -/usr/share/locale/en_US/LC_MESSAGES/ -/usr/share/locale/ru/LC_MESSAGES/ -/usr/share/mime/packages/ -/usr/share/simple-fb2-reader/ - diff --git a/intl/en_US.po b/intl/en_US.po index dd0af29..9ce5008 100644 --- a/intl/en_US.po +++ b/intl/en_US.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: simple-fb2-reader 1.0.0\n" "Report-Msgid-Bugs-To: medved_cool@mail.ru\n" -"POT-Creation-Date: 2015-04-05 03:14+0300\n" -"PO-Revision-Date: 2015-03-30 18:11+0300\n" +"POT-Creation-Date: 2015-04-05 18:09+0300\n" +"PO-Revision-Date: 2015-04-05 18:09+0300\n" "Last-Translator: Automatically generated\n" "Language-Team: none\n" "Language: en_US\n" @@ -121,7 +121,7 @@ msgstr "Not local links not supported\n" #: ../src/fb2/FictionBook/body/section.c:18 ../src/fb2/FictionBook/body.c:15 msgid "No Title" -msgstr "" +msgstr "No Title" #: ../src/fb2/FictionBook/attributes/id.c:26 #, c-format @@ -157,7 +157,7 @@ msgstr "ERROR: failed to encode txt file: %s\n" msgid "ERROR: failed to open txt file: %s\n" msgstr "ERROR: failed to open txt file: %s\n" -#: ../src/callbacks/text_view_callback/link_tag_enevt_callback.c:39 +#: ../src/callbacks/text_view_callback/link_tag_enevt_callback.c:38 #, c-format msgid "ERROR: failed to open URI %s\n" msgstr "ERROR: failed to open URI %s\n" @@ -201,23 +201,22 @@ msgstr "WRONG ENCODE" #: ../src/main.c:20 msgid "Local path to book" -msgstr "" +msgstr "Local path to book" #: ../src/main.c:21 msgid "Print reader version" -msgstr "" +msgstr "Print reader version" -#: ../src/main.c:37 +#: ../src/main.c:38 #, c-format msgid "" "ERROR: %s\n" "\n" msgstr "" +"ERROR: %s\n" +"\n" -#: ../src/main.c:58 -#, fuzzy, c-format +#: ../src/main.c:59 +#, c-format msgid "ERROR: Failed to load gui construct file %s\n" -msgstr "ERROR: failed to encode txt file: %s\n" - -#~ msgid "column" -#~ msgstr "column" +msgstr "ERROR: Failed to load gui construct file %s\n" diff --git a/intl/ru.po b/intl/ru.po index 3d5e419..facf798 100644 --- a/intl/ru.po +++ b/intl/ru.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: simple-fb2-reader 1.0.0\n" "Report-Msgid-Bugs-To: medved_cool@mail.ru\n" -"POT-Creation-Date: 2015-04-05 03:14+0300\n" +"POT-Creation-Date: 2015-04-05 18:09+0300\n" "PO-Revision-Date: 2015-03-30 18:11+0300\n" "Last-Translator: Automatically generated\n" "Language-Team: none\n" @@ -159,7 +159,7 @@ msgstr "ОШИБКА: не удалось раскодировать txt фай msgid "ERROR: failed to open txt file: %s\n" msgstr "ОШИБКА: не удалось открыть txt файл: %s\n" -#: ../src/callbacks/text_view_callback/link_tag_enevt_callback.c:39 +#: ../src/callbacks/text_view_callback/link_tag_enevt_callback.c:38 #, c-format msgid "ERROR: failed to open URI %s\n" msgstr "ОШИБКА: не удалось открыт URI %s\n" @@ -209,7 +209,7 @@ msgstr "Локальный путь до книги" msgid "Print reader version" msgstr "Вывести версию" -#: ../src/main.c:37 +#: ../src/main.c:38 #, c-format msgid "" "ERROR: %s\n" @@ -218,7 +218,7 @@ msgstr "" "ОШИБКА: %s\n" "\n" -#: ../src/main.c:58 +#: ../src/main.c:59 #, fuzzy, c-format msgid "ERROR: Failed to load gui construct file %s\n" msgstr "ОШИБКА: не удалось загрузить файл с каркасом gui: %s\n" diff --git a/intl/simple-fb2-reader.pot b/intl/simple-fb2-reader.pot index e9b1d24..eb7cc49 100644 --- a/intl/simple-fb2-reader.pot +++ b/intl/simple-fb2-reader.pot @@ -7,7 +7,7 @@ msgid "" msgstr "Project-Id-Version: simple-fb2-reader 1.0.0\n" "Report-Msgid-Bugs-To: medved_cool@mail.ru\n" - "POT-Creation-Date: 2015-04-05 03:14+0300\n" + "POT-Creation-Date: 2015-04-05 18:09+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -141,7 +141,7 @@ msgstr "" msgid "ERROR: failed to open txt file: %s\n" msgstr "" -#: ../src/callbacks/text_view_callback/link_tag_enevt_callback.c:39 +#: ../src/callbacks/text_view_callback/link_tag_enevt_callback.c:38 #, c-format msgid "ERROR: failed to open URI %s\n" msgstr "" @@ -191,13 +191,13 @@ msgstr "" msgid "Print reader version" msgstr "" -#: ../src/main.c:37 +#: ../src/main.c:38 #, c-format msgid "ERROR: %s\n" "\n" msgstr "" -#: ../src/main.c:58 +#: ../src/main.c:59 #, c-format msgid "ERROR: Failed to load gui construct file %s\n" msgstr "" diff --git a/makefile.in b/makefile.in index f6e3085..a0af9d6 100644 --- a/makefile.in +++ b/makefile.in @@ -1,5 +1,7 @@ prefix = @prefix@ +exec_prefix = @exec_prefix@ bindir = @bindir@ +exec_prefix = @exec_prefix@ sysconfdir = @sysconfdir@ CC = @CC@ @@ -41,13 +43,27 @@ clean: rm -f $(PROGNAME) # FIXME for new project -install: - install $(PROGNAME) $(DESTDIR)$(prefix)/bin/$(PROGNAME) - cp intl/ru.mo $(DESTDIR)$(prefix)/share/locale/en_US/LC_MESSAGES/$(PROGNAME).mo - cp intl/en_US.mo $(DESTDIR)$(prefix)/share/locale/ru/LC_MESSAGES/$(PROGNAME).mo +mk_folders: + mkdir -p $(DESTDIR)$(prefix)/bin/ + mkdir -p $(DESTDIR)$(prefix)/share/locale/en_US/LC_MESSAGES/ + mkdir -p $(DESTDIR)$(prefix)/share/locale/ru/LC_MESSAGES/ + mkdir -p $(DESTDIR)$(prefix)/share/applications/ + mkdir -p $(DESTDIR)$(prefix)/share/icons/hicolor/scalable/apps/ + mkdir -p $(DESTDIR)$(prefix)/share/mime/packages/ + mkdir -p $(DESTDIR)$(prefix)/share/icons/hicolor/scalable/mimetypes/ + mkdir -p $(DESTDIR)$(sysconfdir)/ + mkdir -p $(DESTDIR)$(prefix)/share/$(PROGNAME)/ + +# FIXME for new project +install:mk_folders + install $(PROGNAME) $(DESTDIR)$(exec_prefix)/bin/$(PROGNAME) + cp intl/ru.mo $(DESTDIR)$(prefix)/share/locale/ru/LC_MESSAGES/$(PROGNAME).mo + cp intl/en_US.mo $(DESTDIR)$(prefix)/share/locale/en_US/LC_MESSAGES/$(PROGNAME).mo cp res/$(PROGNAME).desktop $(DESTDIR)$(prefix)/share/applications/$(PROGNAME).desktop cp res/$(PROGNAME).svg $(DESTDIR)$(prefix)/share/icons/hicolor/scalable/apps/$(PROGNAME).svg cp res/simple-fb2-reader.xml $(DESTDIR)$(prefix)/share/mime/packages/simple-fb2-reader.xml cp res/application-x-fictionbook+xml.svg $(DESTDIR)$(prefix)/share/icons/hicolor/scalable/mimetypes/application-x-fictionbook+xml.svg cp res/simple-fb2-reader_encoding_list.cfg $(DESTDIR)$(sysconfdir)/simple-fb2-reader_encoding_list.cfg + cp res/$(PROGNAME).glade $(DESTDIR)$(prefix)/share/$(PROGNAME)/$(PROGNAME).glade + diff --git a/src/chunks.h b/src/chunks.h index 0f83885..ceef4d7 100644 --- a/src/chunks.h +++ b/src/chunks.h @@ -1,6 +1,8 @@ #ifndef CHUNKS_H_ #define CHUNKS_H_ + #include "config.h" + #include #include //#include @@ -30,24 +32,11 @@ #define ENCODE_BUFF_SIZE 1024 - #ifndef PACKAGE_NAME - #define PACKAGE_NAME "simple-fb2-reader" - #endif - - #ifndef PACKAGE_VERSION - #define PACKAGE_VERSION "1.0.3" - #endif - - #ifndef DEBUG - #ifndef GUI_CONSTRUCT_PATH - #define GUI_CONSTRUCT_PATH "/usr/share/simple-fb2-reader/simple-fb2-reader.glade" - #endif - - #ifndef ENCODE_LIST_PATH - #define ENCODE_LIST_PATH "/etc/simple-fb2-reader_encoding_list.cfg" - #endif - #else + #ifdef DEBUG + #undef GUI_CONSTRUCT_PATH #define GUI_CONSTRUCT_PATH "./res/simple-fb2-reader.glade" + + #undef ENCODE_LIST_PATH #define ENCODE_LIST_PATH "./res/simple-fb2-reader_encoding_list.cfg" #endif diff --git a/src/config.h b/src/config.h new file mode 100644 index 0000000..43d7c55 --- /dev/null +++ b/src/config.h @@ -0,0 +1,5 @@ +/* src/config.h. Generated from config.h.in by configure. */ +#define GUI_CONSTRUCT_PATH "/usr/share/simple-fb2-reader/simple-fb2-reader.glade" +#define ENCODE_LIST_PATH "/etc/simple-fb2-reader_encoding_list.cfg" +#define PACKAGE_VERSION "1.0.4" +#define PACKAGE_NAME "simple-fb2-reader" diff --git a/src/config.h.in b/src/config.h.in new file mode 100644 index 0000000..0dcb11d --- /dev/null +++ b/src/config.h.in @@ -0,0 +1,4 @@ +#define GUI_CONSTRUCT_PATH "/usr/share/simple-fb2-reader/simple-fb2-reader.glade" +#define ENCODE_LIST_PATH "/etc/simple-fb2-reader_encoding_list.cfg" +#define PACKAGE_VERSION "1.0.0" +#define PACKAGE_NAME "simple-fb2-reader" diff --git a/src/main.c b/src/main.c index 6c8e2a2..1bcc38b 100644 --- a/src/main.c +++ b/src/main.c @@ -17,8 +17,8 @@ int main(int argc, char *argv[]) gboolean print_version = FALSE; GOptionEntry cmd_options[] = { - {"book", 'b', G_OPTION_FLAG_NONE, G_OPTION_ARG_FILENAME, &book_file_path, _C("Local path to book"), "/local/path/book.fb2"}, - {"version", 'v', G_OPTION_FLAG_NONE, G_OPTION_ARG_NONE, &print_version, _C("Print reader version"), NULL}, + {"book", 'b', 0, G_OPTION_ARG_FILENAME, &book_file_path, _C("Local path to book"), "/local/path/book.fb2"}, + {"version", 'v', 0, G_OPTION_ARG_NONE, &print_version, _C("Print reader version"), NULL}, {NULL} }; @@ -31,8 +31,9 @@ int main(int argc, char *argv[]) gchar **cmd_line = g_strdupv(argv); + gint cmd_count = argc; - if(g_option_context_parse_strv(cmd_context, &cmd_line, &error) == FALSE) + if(g_option_context_parse(cmd_context, &cmd_count, &cmd_line, &error) == FALSE) { fprintf(stderr, _C("ERROR: %s\n\n"), error->message);