rpms/kita/F-9 kita-0.177.4-cookie-change.patch, NONE, 1.1 .cvsignore, 1.2, 1.3 kita.spec, 1.13, 1.14 sources, 1.2, 1.3 kita-0.177.3-cookie-change.patch, 1.1, NONE

Mamoru Tasaka mtasaka at fedoraproject.org
Tue Sep 16 18:43:13 UTC 2008


Author: mtasaka

Update of /cvs/extras/rpms/kita/F-9
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv18400/F-9

Modified Files:
	.cvsignore kita.spec sources 
Added Files:
	kita-0.177.4-cookie-change.patch 
Removed Files:
	kita-0.177.3-cookie-change.patch 
Log Message:
* Wed Sep 17 2008 Mamoru Tasaka <mtasaka at ioa.s.u-tokyo.ac.jp> - 0.177.4-1
- 0.177.4


kita-0.177.4-cookie-change.patch:

--- NEW FILE kita-0.177.4-cookie-change.patch ---
--- kita-0.177.4/kita/src/write/writeview.cpp.cookie	2008-09-16 21:56:03.000000000 +0900
+++ kita-0.177.4/kita/src/write/writeview.cpp	2008-09-16 22:41:39.000000000 +0900
@@ -43,6 +43,9 @@
 #include <qcheckbox.h>
 #include <qlayout.h>
 
+#include <cstring>
+#include <cstdlib>
+
 /* result code */
 enum{
     K2ch_Unknown,
@@ -191,6 +194,10 @@
     for ( it = list.begin(); it != list.end(); ++it ) {
         faceCombo->insertItem( *it );
     }
+
+    cookie_type = NULL;
+    cookie_value = NULL;
+
 }
 
 
@@ -344,12 +351,48 @@
     m_array.append( data.data() );
 }
 
+void KitaWriteView::find_cookie_typevalue( const char *response ){
+	char *str_cmp, *str;
+	static char *cookie_type_static = NULL;
+	static char *cookie_value_static = NULL;
+	cookie_type = cookie_value = NULL;
+
+	str_cmp = "<input type=hidden name=\"";
+	str = strstr(response, str_cmp);
+	if (str){
+		char *str2 = strstr(str, "\"");
+		char *str3 = NULL;
+		str2++;
+		if ((!cookie_type_static) || (!(strstr(str2, cookie_type_static)))){
+			free(cookie_type_static);
+			free(cookie_value_static);
+
+			cookie_type_static = strdup(str2);
+			str3 = strstr(cookie_type_static, "\"");
+			*str3 = 0;
+
+			str = str2;
+			str2 = strstr(str, "value=\"");
+			str = str2;
+			str2 = strstr(str, "\"");
+			str2++;
+			cookie_value_static = strdup(str2);
+			str3 = strstr(cookie_value_static, "\"");
+			*str3 = 0;
+		}
+	}
+	cookie_type = cookie_type_static;
+	cookie_value = cookie_value_static;
+}
+
+
 
 /* This slot is called when posting is done. */
 /* see also slotPostMessage()                */ /* private slot */
 void KitaWriteView::slotPostFinished( KIO::Job* )
 {
     QString response;
+    const char *response_ascii;
 
     // x-euc-jp & euc-jp
     if ( m_array.contains( "euc-jp" ) ) {
@@ -401,6 +444,9 @@
         /* eat cookie, then re-post message */
     case K2ch_Cookie:
 
+	response_ascii = (const char *) QString::fromLocal8Bit(response).utf8();
+	find_cookie_typevalue(response_ascii);
+
         if ( KMessageBox::questionYesNo( 0,
                                          QTextCodec::codecForName( "utf8" ) ->toUnicode( KITAUTF8_WRITECOOKIEMSG ),
                                          resultTitle( response ) )
@@ -510,6 +556,12 @@
     ( ret += "&MESSAGE=" ) += KURL::encode_string( bodyText->text(), mib );
     ( ret += "&bbs=" ) += Kita::BoardManager::boardID( m_datURL );
     ( ret += "&suka=pontan" );
+    if (cookie_type){
+	ret += "&";
+	ret += cookie_type;
+	ret += "=";
+	ret += cookie_value;
+    }
 
     /* key */
     if ( m_mode == WRITEMODE_NORMAL ) ( ret += "&key=" ) += Kita::DatManager::threadID( m_datURL );
--- kita-0.177.4/kita/src/write/writeview.h.cookie	2005-05-03 13:10:26.000000000 +0900
+++ kita-0.177.4/kita/src/write/writeview.h	2008-09-16 22:41:30.000000000 +0900
@@ -45,6 +45,9 @@
 
     static QCp932Codec* m_cp932Codec;
 
+    char *cookie_type;
+    char *cookie_value;
+
 public:
 
     KitaWriteView( QWidget* parent, const char* name, const KURL& url, int mode, const QString& newThreadName = QString::null );
@@ -70,6 +73,7 @@
     void slotRecieveData( KIO::Job*, const QByteArray& );
     void slotPostFinished( KIO::Job* );
     void slotCurrentChanged ( QWidget * w );
+    void find_cookie_typevalue( const char *response );
     bool slotBodyTextChanged();
 
 private:


Index: .cvsignore
===================================================================
RCS file: /cvs/extras/rpms/kita/F-9/.cvsignore,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- .cvsignore	30 Aug 2006 11:28:39 -0000	1.2
+++ .cvsignore	16 Sep 2008 18:42:43 -0000	1.3
@@ -1 +1 @@
-kita-0.177.3.tar.gz
+kita-0.177.4.tar.gz


Index: kita.spec
===================================================================
RCS file: /cvs/extras/rpms/kita/F-9/kita.spec,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- kita.spec	16 Sep 2008 06:03:30 -0000	1.13
+++ kita.spec	16 Sep 2008 18:42:43 -0000	1.14
@@ -1,12 +1,13 @@
-%define     version     0.177.3
+%define     version     0.177.4
+%define	    repood      32918
 
 Summary:    2ch client for KDE
 Name:       kita
 Version:    %{version}
-Release:    14%{?dist}
-Source:     http://downloads.sourceforge.jp/kita/20336/kita-%{version}.tar.gz
-Patch0:     kita-0.177.3-nonweak-symbol.patch
-Patch1:	    kita-0.177.3-cookie-change.patch
+Release:    1%{?dist}
+Source:     http://downloads.sourceforge.jp/kita/%{repoid}/kita-%{version}.tar.gz
+#Patch0:     kita-0.177.3-nonweak-symbol.patch
+Patch1:	    kita-0.177.4-cookie-change.patch
 License:    GPLv2+
 URL:        http://sourceforge.jp/projects/kita/
 Group:      Applications/Internet
@@ -14,17 +15,17 @@
 BuildRoot:  %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 BuildRequires:       libart_lgpl-devel
-%if 0%{?fedora} >= 8
 BuildRequires:       kdelibs3-devel
-%else
-BuildRequires:       kdelibs-devel
-%endif
+
+BuildRequires:       automake
+BuildRequires:       libtool
 BuildRequires:       desktop-file-utils
+BuildRequires:       gettext
 
 Requires(post):      /sbin/ldconfig 
 Requires(postun):    /sbin/ldconfig
 %if 0%{?fedora} >= 10
-Requires:            VLGothic-fonts
+Requires:            mona-fonts-VLGothic
 %else
 Requires:            fonts-japanese
 %endif
@@ -35,16 +36,23 @@
 %prep
 %setup -q
 
-%patch0 -p2 -b .link
+#%%patch0 -p2 -b .link
 %patch1 -p1 -b .cookie
 
 %{__sed} -i.soname \
-   -e 's|^kita\([\._][lL]\)|libkitamain\1|' \
-   -e 's|\([^a-zA-Z]\)kita\([\._][lL]\)|\1libkitamain\2|g' \
+   -e 's|kita_la_|libkitamain_la_|' \
+   -e 's| kita\.la| libkitamain.la|' \
    -e 's|-avoid-version||' \
-   kita/src/Makefile.in
+   kita/src/Makefile.{in,am}
+	
+
+%{__sed} -i.dsktop -e 's|Terminal=0|Terminal=false|' \
+   kita/src/kita.desktop
+
+make dist -f Makefile.cvs
 
 %build
+export LDFLAGS="-Wl,--rpath,%{_libdir}/%{name}"
 if [ %{_arch} == x86_64 -o %{_arch} == ppc64 ] ; then
    SUF=64
 else
@@ -57,16 +65,20 @@
 %configure \
     --disable-rpath \
     --enable-libsuffix=$SUF \
+    --libdir=%{_libdir}/%{name} \
     --enable-xdg-menu
 
-%{__make} %{?_smp_mflags}
+# -j2 failed
+%{__make} -j1
 
 %install
 %{__rm} -rf %{buildroot}
-%{__make} DESTDIR=%{buildroot} install
 
-%{__sed} -i -e 's|Terminal=0|Terminal=false|' \
-      %{buildroot}/%{name}.desktop
+export LDFLAGS="-Wl,--rpath,%{_libdir}/%{name}"
+%{__make} \
+   kdelnkdir=%{_datadir}/applications \
+   DESTDIR=%{buildroot} \
+   install
 
 desktop-file-install \
       --delete-original \
@@ -74,22 +86,20 @@
       --dir %{buildroot}%{_datadir}/applications \
       --add-category KDE \
       --add-category Qt \
-      %{buildroot}/%{name}.desktop
+      --remove-category Application \
+      %{buildroot}/%{_datadir}/applications/%{name}.desktop
 
 # remove unneeded files
-%{__rm} -f %{buildroot}%{_prefix}/lib*/*.{la,so}
-
-# move document files
-%{__mkdir} DOC
+find %{buildroot}%{_libdir} -name \*.so -or \*.la | xargs %{__rm} -f
 
 unlink %{buildroot}%{_datadir}/doc/HTML/en/kita/common
 ln -sf ../common %{buildroot}%{_datadir}/doc/HTML/en/kita/common
 
 # convert encoding
 for f in README README.2ch TODO ; do
-   %{__mv} ${f} ${f}.tmp
-   iconv -f EUCJP -t UTF8 ${f}.tmp > ${f} && \
-      %{__rm} -f ${f}.tmp || %{__mv} ${f}.tmp ${f}
+   iconv -f EUCJP -t UTF8 ${f} > ${f}.tmp && \
+      ( touch -r ${f} ${f}.tmp ; %{__mv} -f ${f}.tmp ${f} )
+   %{__rm} -f ${f}.tmp
 done
 
 # install mo file
@@ -113,16 +123,21 @@
 exit 0
 
 %files -f %{name}.lang
-%defattr(-, root, root)
+%defattr(-, root, root,-)
 %doc AUTHORS COPYING ChangeLog README README.2ch TODO
 %{_bindir}/*
-%{_prefix}/lib*/*.so.*
-%{_datadir}/apps/kita/
+%{_libdir}/%{name}/
+%{_datadir}/apps/%{name}/
+
 %{_datadir}/applications/fedora-%{name}.desktop
 %{_datadir}/icons/hicolor/*/apps/*.png
+
 %{_datadir}/doc/HTML/en/kita/
 
 %changelog
+* Wed Sep 17 2008 Mamoru Tasaka <mtasaka at ioa.s.u-tokyo.ac.jp> - 0.177.4-1
+- 0.177.4
+
 * Tue Sep 16 2008 Mamoru Tasaka <mtasaka at ioa.s.u-tokyo.ac.jp> - 0.177.3-14
 - Workaround to 2ch cookie style change
 


Index: sources
===================================================================
RCS file: /cvs/extras/rpms/kita/F-9/sources,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- sources	30 Aug 2006 11:28:39 -0000	1.2
+++ sources	16 Sep 2008 18:42:43 -0000	1.3
@@ -1 +1 @@
-7380db08c5ec321154ebba744d5609b9  kita-0.177.3.tar.gz
+0c183e1925883b165a50d88bff8380cb  kita-0.177.4.tar.gz


--- kita-0.177.3-cookie-change.patch DELETED ---




More information about the fedora-extras-commits mailing list