Hello community, here is the log from the commit of package ohcount for openSUSE:Factory checked in at 2012-12-07 14:43:37 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ohcount (Old) and /work/SRC/openSUSE:Factory/.ohcount.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ohcount", Maintainer is "" Changes: -------- New Changes file: --- /dev/null 2012-11-30 12:21:47.308011256 +0100 +++ /work/SRC/openSUSE:Factory/.ohcount.new/ohcount.changes 2012-12-07 14:43:39.000000000 +0100 @@ -0,0 +1,4 @@ +------------------------------------------------------------------- +Fri Nov 16 01:12:42 UTC 2012 - [email protected] + +- Initial package (version 3.0.0.g297) for build.opensuse.org New: ---- cflags.diff ohcount-3.0.0.g297.tar.xz ohcount.changes ohcount.spec shared.diff swig-ruby19.diff ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ohcount.spec ++++++ # # spec file for package ohcount # # Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via http://bugs.opensuse.org/ # Name: ohcount %define lname libohcount Version: 3.0.0.g297 Release: 0 # git-describe: 2.0.1-297-g6cb04fe Url: http://ohloh.net/p/ohcount Summary: The Ohloh source code line counter License: GPL-2.0 Group: Development/Tools/Other # http://sourceforge.net/projects/ohcount/files/ is no longer updated it seems. #Git-Clone: git://github.com/blackducksw/ohcount Source: %name-%version.tar.xz Patch1: cflags.diff Patch2: swig-ruby19.diff Patch3: shared.diff BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: bash BuildRequires: file-devel BuildRequires: gcc >= 4.1.2 BuildRequires: gperf BuildRequires: pcre-devel BuildRequires: pkg-config BuildRequires: ragel >= 6.3, ruby-devel BuildRequires: swig BuildRequires: xz BuildRequires: pkgconfig(ruby-1.9) %description Ohcount supports over 70 popular programming languages, and has been used to count over 6 billion lines of code by 300,000 developers. Ohcount does more more than just count lines of code. It can also detect popular open source licenses such as GPL within a large directory of source code. It can also detect code that targets a particular programming API, such as Win32 or KDE. %package -n %lname Summary: Ohcount source code analyzer library Group: System/Libraries %description -n %lname The core parsing library for the Ohcount source code analyzer program and for its ruby bindings. %package ruby Summary: Ruby bindings for the Ohcount source code analyzer Group: Development/Languages/Ruby %description ruby Ruby bindings for the Ohcount source code analyzer. %prep %setup -qn %name %patch -P 1 -P 2 -P 3 -p1 %build export CFLAGS="%optflags $(pkg-config ruby-1.9 --cflags)"; export SHARED="-Wl,-soname,libohcount.so"; ./build ohcount; ./build ruby; %install b="%buildroot"; mkdir -p "$b/%_bindir" "$b/%_libdir"; install -pm0755 bin/ohcount "$b/%_bindir/"; install -pm0755 src/libohcount*.so "$b/%_libdir/"; r="$b/%_libdir/ruby/vendor_ruby/$(pkg-config ruby-1.9 --modversion)"; mkdir -p "$r"; cp -a ruby "$r/"; rm -f "$r"/*.{c,i}; %post -n %lname -p /sbin/ldconfig %postun -n %lname -p /sbin/ldconfig %files %defattr(-,root,root) %doc COPYING %_bindir/ohcount %files -n libohcount %defattr(-,root,root) %_libdir/libohcount.so %files ruby %defattr(-,root,root) %_libdir/ruby %changelog ++++++ cflags.diff ++++++ From: Jan Engelhardt <[email protected]> Date: 2012-11-16 01:01:33.597645291 +0100 Tweak the build script so that we can actually _pass_ some flags in. --- build | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) Index: ohcount/build =================================================================== --- ohcount.orig/build +++ ohcount/build @@ -17,7 +17,7 @@ then fi # You shouldn't have to change the following. - CFLAGS=-O3 + CFLAGS="-O3 $CFLAGS" WARN="-Wall -Wno-pointer-to-int-cast -Wno-parentheses" SHARED=-shared SHARED_NAME=libohcount.so @@ -28,7 +28,7 @@ else INC_DIR=/opt/local/include LIB_DIR=/opt/local/lib # You shouldn't have to change the following. - CFLAGS="-fno-common -g" + CFLAGS="-fno-common -g $CFLAGS" WARN="-Wall -Wno-parentheses" SHARED="-dynamiclib -L$LIB_DIR -lpcre" SHARED_NAME=libohcount.dylib ++++++ shared.diff ++++++ --- build | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) Index: ohcount/build =================================================================== --- ohcount.orig/build +++ ohcount/build @@ -19,8 +19,10 @@ then # You shouldn't have to change the following. CFLAGS="-O3 $CFLAGS" WARN="-Wall -Wno-pointer-to-int-cast -Wno-parentheses" - SHARED=-shared + SHARED="-shared $SHARED" + if [ -z "$SHARED_NAME" ]; then SHARED_NAME=libohcount.so + fi RB_SHARED=-shared RB_SHARED_NAME=ohcount.so else @@ -86,17 +88,16 @@ build_shared() ! -z `find src/*.{h,c} -newer src/$SHARED_NAME` ]] then echo "Building shared library" - sh -c "$cc $SHARED $files -o src/$SHARED_NAME" || exit 1 + sh -c "$cc $SHARED $files -o src/$SHARED_NAME -lpcre -lmagic" || exit 1 fi } build_ohcount() { - build_hash_headers - build_parser_o + build_shared echo "Building Ohcount" mkdir -p bin/ - sh -c "$cc src/ohcount.c $files -o bin/ohcount -lpcre -lmagic" || exit 1 + sh -c "$cc src/ohcount.c -o bin/ohcount -Lsrc -lohcount -lpcre -lmagic" || exit 1 } build_test_suite() @@ -119,10 +120,9 @@ build_ruby_bindings() echo "Generating Ruby bindings for $arch" sh -c "swig -ruby -o ruby/ohcount_wrap.c ruby/ohcount.i" || exit 1 mkdir -p ruby/$arch - sh -c "$cc $RB_SHARED ruby/ohcount_wrap.c $files -o ruby/$arch/$RB_SHARED_NAME \ + sh -c "$cc $RB_SHARED ruby/ohcount_wrap.c -o ruby/$arch/$RB_SHARED_NAME \ -I`ruby -rmkmf -e 'print Config::expand(CONFIG["archdir"])'` \ - -lpcre -lmagic" || exit 1 - sh -c "cd test/unit/ruby && ruby ruby_test.rb" || exit 1 + -Lsrc -lohcount" || exit 1 } if [ $# -eq 0 ] || [ $1 == "all" ] ++++++ swig-ruby19.diff ++++++ From: Jan Engelhardt <[email protected]> Date: 2012-11-16 01:14:44.882225232 +0100 build: let build succeed with ruby 1.9 --- ruby/ohcount.i | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) Index: ohcount/ruby/ohcount.i =================================================================== --- ohcount.orig/ruby/ohcount.i +++ ohcount/ruby/ohcount.i @@ -12,8 +12,8 @@ %typemap(in) (register const char *str, register unsigned int len) { Check_Type($input, T_STRING); - $1 = STR2CSTR($input); - $2 = RSTRING($input)->len; + $1 = StringValuePtr($input); + $2 = RSTRING_LEN($input); }; %typemap(out) char ** { @@ -111,9 +111,9 @@ } #if defined(SWIGRUBY) void set_filenames(VALUE filenames) { - int i, length = RARRAY(filenames)->len; + int i, length = RARRAY_LEN(filenames); char **fnames = calloc(length + 1, sizeof(char *)); - VALUE *iter = RARRAY(filenames)->ptr; + VALUE *iter = RARRAY_PTR(filenames); for (i = 0; i < length; i++, iter++) fnames[i] = StringValuePtr(*iter); self->filenames = fnames; @@ -124,10 +124,10 @@ VALUE val; val = rb_hash_aref(opt_hash, ID2SYM(rb_intern("contents"))); if (val && rb_type(val) == T_STRING) - ohcount_sourcefile_set_contents(sourcefile, STR2CSTR(val)); + ohcount_sourcefile_set_contents(sourcefile, StringValuePtr(val)); val = rb_hash_aref(opt_hash, ID2SYM(rb_intern("file_location"))); if (val && rb_type(val) == T_STRING) - ohcount_sourcefile_set_diskpath(sourcefile, STR2CSTR(val)); + ohcount_sourcefile_set_diskpath(sourcefile, StringValuePtr(val)); val = rb_hash_aref(opt_hash, ID2SYM(rb_intern("filenames"))); if (val && rb_type(val) == T_ARRAY) SourceFile_set_filenames(sourcefile, val); @@ -214,12 +214,12 @@ static VALUE rb_add_directory(VALUE directory, SourceFileList *list) { if (directory && rb_type(directory) == T_STRING) - ohcount_sourcefile_list_add_directory(list, STR2CSTR(directory)); + ohcount_sourcefile_list_add_directory(list, StringValuePtr(directory)); return Qnil; } static VALUE rb_add_file(VALUE file, SourceFileList *list) { if (file && rb_type(file) == T_STRING) - ohcount_sourcefile_list_add_file(list, STR2CSTR(file)); + ohcount_sourcefile_list_add_file(list, StringValuePtr(file)); return Qnil; } SourceFileList(VALUE opt_hash=NULL) { -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
