From 86e67f3b95544983f1b7284967a3adf5dcbb6765301835af897acb325b9a07c7 Mon Sep 17 00:00:00 2001 From: Stephan Kulow Date: Sat, 26 Mar 2011 09:28:50 +0000 Subject: [PATCH] Accepting request 65005 from home:jengelh:dev OBS-URL: https://build.opensuse.org/request/show/65005 OBS-URL: https://build.opensuse.org/package/show/devel:tools/cdecl?expand=0&rev=1 --- .gitattributes | 23 ++++++++++++ cdecl-2.5-deb11.diff | 88 ++++++++++++++++++++++++++++++++++++++++++++ cdecl-2.5.tar.xz | 3 ++ cdecl.changes | 4 ++ cdecl.spec | 46 +++++++++++++++++++++++ 5 files changed, 164 insertions(+) create mode 100644 .gitattributes create mode 100644 cdecl-2.5-deb11.diff create mode 100644 cdecl-2.5.tar.xz create mode 100644 cdecl.changes create mode 100644 cdecl.spec diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/cdecl-2.5-deb11.diff b/cdecl-2.5-deb11.diff new file mode 100644 index 0000000..aa155f1 --- /dev/null +++ b/cdecl-2.5-deb11.diff @@ -0,0 +1,88 @@ +--- cdecl-2.5.orig/Makefile ++++ cdecl-2.5/Makefile +@@ -15,9 +15,9 @@ + # + # add -DUSE_READLINE To compile in support for the GNU readline library. + +-CFLAGS= -s -O2 -DUSE_READLINE ++CFLAGS= -g -O2 -DUSE_READLINE + CC= gcc +-LIBS= -lreadline -ltermcap ++LIBS= -lreadline + ALLFILES= makefile cdgram.y cdlex.l cdecl.c cdecl.1 testset testset++ + BINDIR= /usr/bin + MANDIR= /usr/man/man1 +@@ -26,7 +26,7 @@ + INSTALL_DATA= install -c -m 644 + + cdecl: c++decl +- ln c++decl cdecl ++ ln -s c++decl cdecl + + c++decl: cdgram.c cdlex.c cdecl.c + $(CC) $(CFLAGS) -o c++decl cdecl.c $(LIBS) +@@ -44,7 +44,7 @@ + + install: cdecl + $(INSTALL) cdecl $(BINDIR) +- ln $(BINDIR)/cdecl $(BINDIR)/c++decl ++ ln -s cdecl $(BINDIR)/c++decl + $(INSTALL_DATA) cdecl.1 $(MANDIR) + $(INSTALL_DATA) c++decl.1 $(MANDIR) + +--- cdecl-2.5.orig/cdecl.1 ++++ cdecl-2.5/cdecl.1 +@@ -274,7 +274,7 @@ + ::= short | long | unsigned | signed | + ::= | NOTHING + ::= const | volatile | noalias +- ::= auto | extern | register | auto ++ ::= auto | extern | register | static + ::= NOTHING | + ::= NOTHING | + | create | nocreate +--- cdecl-2.5.orig/cdecl.c ++++ cdecl-2.5/cdecl.c +@@ -67,6 +67,7 @@ + # include + # include + # include ++# include + #else + # ifndef NOVARARGS + # include +@@ -90,7 +91,7 @@ + #ifdef USE_READLINE + # include + /* prototypes for functions related to readline() */ +- char * getline(); ++ char * get_line(); + char ** attempt_completion(char *, int, int); + char * keyword_completion(char *, int); + char * command_completion(char *, int); +@@ -124,7 +125,6 @@ + + #if __STDC__ + char *ds(char *), *cat(char *, ...), *visible(int); +- int getopt(int,char **,char *); + int main(int, char **); + int yywrap(void); + int dostdin(void); +@@ -375,7 +375,7 @@ + static char *line_read = NULL; + + /* Read a string, and return a pointer to it. Returns NULL on EOF. */ +-char * getline () ++char * get_line () + { + /* If the buffer has already been allocated, return the memory + to the free pool. */ +@@ -887,7 +887,7 @@ + + if (!quiet) (void) printf("Type `help' or `?' for help\n"); + ret = 0; +- while ((line = getline())) { ++ while ((line = get_line())) { + if (!strcmp(line, "quit") || !strcmp(line, "exit")) { + free(line); + return ret; diff --git a/cdecl-2.5.tar.xz b/cdecl-2.5.tar.xz new file mode 100644 index 0000000..342c569 --- /dev/null +++ b/cdecl-2.5.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8259d3e811c2c54c30d83259d5207b23c5a39aa1b371975f08ef5fb0abadafc5 +size 19548 diff --git a/cdecl.changes b/cdecl.changes new file mode 100644 index 0000000..4ed10da --- /dev/null +++ b/cdecl.changes @@ -0,0 +1,4 @@ +------------------------------------------------------------------- +Fri Aug 13 00:56:53 UTC 2010 - jengelh@medozas.de + +- Add -DOLD_READLINE to get prototypes into scope diff --git a/cdecl.spec b/cdecl.spec new file mode 100644 index 0000000..89c7b0c --- /dev/null +++ b/cdecl.spec @@ -0,0 +1,46 @@ + +Name: cdecl +Version: 2.5 +Release: 0 +Group: Development/Languages/C and C++ +Summary: C/C++ function declaration translator +URL: ftp://ftp.oss.cc.gatech.edu/pub/linux/devel/lang/c/cdecl-2.5.tar.gz +License: DFSG + +Source: %name-%version.tar.xz +Patch1: %name-2.5-deb11.diff +BuildRoot: %_tmppath/%name-%version-build +BuildRequires: bison, flex, readline-devel, xz + +%description +Turn English phrases to C or C++ declarations Cdecl is a program +which will turn English-like phrases such as "declare foo as array 5 +of pointer to function returning int" into C declarations such as +"int (*foo[5])()". It can also translate the C into the +pseudo-English. And it handles typecasts, too. Plus C++. And in this +version it has command line editing and history with the GNU readline +library. + +Author: +------- + David R. Conrad + +%prep +%setup +%patch -P 1 -p1 + +%build +make CFLAGS="%optflags -DUSE_READLINE -DOLD_READLINE"; + +%install +b="%buildroot"; +install -dm0755 "$b/%_bindir"; +install -dm0755 "$b/%_mandir/man1"; +make install BINDIR="$b/%_bindir" MANDIR="$b/%_mandir/man1"; + +%files +%defattr(-,root,root) +%_bindir/* +%_mandir/*/* + +%changelog