sted2-20021104-2kkr2010.0.spec
%define name sted2
%define version 20021104
%define release %mkrel 2
%define use_nls 1
%define use_milkjf 1
%{?_without_nls: %global use_nls 0}
%{?_without_milkjf: %global use_milkjf 0}
Summary: High-performance MIDI sequence editor / Music composer system
Summary(ja): 高機能な MIDI シーケンスエディタ・ミュージックコンポーザ
Name: %{name}
Version: %{version}
Release: %{release}
Source0: http://sted2.sourceforge.net/pub/%{name}-%{version}.tar.gz
# Size : 540,511
# MD5 : 1ed869e2d7936086dcb6a05cc64e2d16
# SHA-1 : 73efb7a8711e8a3ef352b9cd4eb4eaae64acf6bd
Source1: sc88pro.def.lzma
# Size : 11,618
# MD5 : 26b8882531b5b666149a44ca142b1d91
# SHA-1 : f08cb07dc72a2705d74854c99d444d4d6358fb76
Source2: sc8850.def.lzma
# Size : 15,583
# MD5 : 467d198434dc56cd2e4a51b8d38ee8e0
# SHA-1 : 1e6e7d97d89fa4df29ce5006244cf21e32d37955
Source3: sted2.desktop
# Size : 341
# MD5 : 74c4be3a7a85b5c7ea3b83b08e776d68
# SHA-1 : 081b4a37c15acc6bacbeddfee42b95f25c0988c1
Source4: sted2.xml
# Size : 435
# MD5 : 8b862c0bec9c0cd1bbe1eb170174a278
# SHA-1 : 18169c0435858e1e79e512bbd1dda9efffede7b8
Patch0: %{name}-%{version}-configfile.patch
# Size : 4,438
# MD5 : d779d6efed15ed03342ded03393325ab
# SHA-1 : 5e559ab5b48d68378d9dfe13236ae56aefeb1a11
Patch1: %{name}-%{version}-drop-cm6con.patch
# Size : 1,985
# MD5 : 437d9767761db724d790e32bf284d091
# SHA-1 : 43d76cc34f5bd92494abd737c983a02e668e86f0
Patch2: %{name}-%{version}-keysub.patch
# Size : 627
# MD5 : 65d570d6927fad52128f673d9b5579db
# SHA-1 : 891cd34e2d89c36d28a86047c5bc55376ea301e3
Patch3: %{name}-%{version}-score-layout.patch
# Size : 1,194
# MD5 : ddd51d5240715972e8adb5fd58c266ee
# SHA-1 : 0974098c6f726468b52cab151e3e0587bd0a0028
Patch4: %{name}-%{version}-score-notes-usenls.patch
# Size : 3,595
# MD5 : 823252ccaa4de1989a9fe28bc3ad31c9
# SHA-1 : 8e46ab921d6c380e513e7bd85ab36036346d81c5
Patch5: %{name}-%{version}-score-notes-nonls.patch
# Size : 1,106
# MD5 : 0b5b4d9e7fb0636c2309bfba341387d1
# SHA-1 : 9d3ce73b2053c024d7628151256a53bad95b1df4
Patch6: %{name}-%{version}-score-symbols.patch
# Size : 1,919
# MD5 : afc8282d90287fbbc78557ca3d41be96
# SHA-1 : 60d99ea97cf41916c287f862236e58dca0fc6a77
Patch7: %{name}-%{version}-sted2rc-order.patch
# Size : 1,009
# MD5 : 945e0a82becc62ea67dd004ae876ff49
# SHA-1 : baa03ac5a8a921bb8324a99a91e6c90729ee4277
Patch8: %{name}-%{version}-syntax.patch
# Size : 1,637
# MD5 : 0de039eb4573f506ebab4c4f33b5df22
# SHA-1 : 30298f0a7f1808550e007dc742d41d4b99135df8
Patch9: %{name}-%{version}-tonelist-size.patch
# Size : 678
# MD5 : 27d2ba2bf81b13869d6b2e7f108dd7a5
# SHA-1 : 7ec87b6b2eb23db33f25c169ed3e0c25576a5272
Patch10: %{name}-%{version}-xcreatefontset.patch
# Size : 370
# MD5 : c14f95b9530670861b026a98995c2f9b
# SHA-1 : 8a5c401d9b9ffaba94ae747ac9e0e7cc2db90278
Patch11: %{name}-%{version}-xgettext-encoding.patch
# Size : 335
# MD5 : cdf0289fd63659a7cd4c21ef6a70a991
# SHA-1 : 55318216c5c48f99be989aa468fc99c2db229941
URL: http://sted2.sourceforge.net/
License: Public Domain
Group: Sound
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
BuildRequires: libx11-devel
Suggests: sayleen TiMidity++
%if %{use_milkjf}
Suggests: fonts-bitmap-milkjf
%endif
%description
STed2 is the high-performance MIDI sequence editor / Music composer system. It had been working on X680x0 old Japanese personal workstation.
The STed has originally been developed by Mr. Takayuki "TURBO" Toda.
%description -l ja
STed2 とは、X680x0 というパーソナルワークステーション上で動作した、高機能な MIDI シーケンスエディタ・ミュージックコンポーザです。
原作者は TURBO(故戸田貴之)氏です。
%prep
%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%if %{use_nls}
%patch4 -p1
%else
%patch5 -p1
%endif
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
%patch10 -p1
%patch11 -p1
%{__cp} -a %{SOURCE1} %{SOURCE2} .
%{__lzma} -d *.lzma
%if %{use_milkjf}
# optimize note's position for milkjf (graphic display)
%{__sed} -i \
-e 's:\(g_print(xx,y\)\(,tmp0,15);\):\1-1\2:' \
-e 's:\(if(sff>0){g_print(xx-14,y\)\(,_("#"),15);}\):\1-1\2:' \
-e 's:\(if(sff<0){g_print(xx-10,y\)\(,_("="),15);}\):\1-1\2:' \
-e 's:\(for(i=0;i<a;i++){g_print(x,y+sharp_yp[i+bs]\)\(,tmp0,15);x+=4;}\):\1+2\2:' sted2/score.c
# change default font to milkjf
%{__sed} -i "s:\(#font_name=.*16.*\):*\1\n#font_name=-milkjf-fixed-\\\*-r-normal--16-\\\*-\\\*-\\\*:" etc/sted2.cnf.in
%endif
# avoid access violation
%{__sed} -i 's: \($(INSTALL_PATH)\): %{buildroot}\1:' etc/Makefile.in
%build
# build for X11
myconf="--with-default-path=%{_sysconfdir}/sted2 --without-ncurses"
%if ! %{use_nls}
myconf="${myconf} --disable-nls"
%endif
%configure2_5x ${myconf}
%make
%install
# clean
%{__rm} %{buildroot} -fr
# base
%makeinstall
# def
%{__install} -p -m 644 *.def %{buildroot}/%{_sysconfdir}/sted2/deffile/
# desktop
%{__install} -D -p -m 644 %{SOURCE3} %{buildroot}/%{_datadir}/applications/sted2.desktop
# mime
%{__install} -D -p -m 644 %{SOURCE4} %{buildroot}/%{_datadir}/mime/packages/sted2.xml
# doc
%{__lzma} AUTHORS ChangeLog* README* doc/{FAQ,memo} doc/original_docs/{[rst]*.*,sted207/sted2*.[dhm]*}
%post
%if %{mdkversion} < 200900
%update_desktop_database
%update_mime_database
%endif
%if %{use_milkjf}
if [ ${1} -eq 1 ] && ! %{__grep} "substitute.*JISX0208.1990-0:GL" %{_datadir}/X11/locale/ja_JP.UTF-8/XLC_LOCALE; then
%{__cp} -a %{_datadir}/X11/locale/ja_JP.UTF-8/XLC_LOCALE{,.rpmsave-sted2}
%{__sed} -i 's/\(primary.*JISX0208.1983-0:GL\)/\1\n\t\tsubstitute\tJISX0208.1990-0:GL/' %{_datadir}/X11/locale/ja_JP.UTF-8/XLC_LOCALE
fi
%endif
%postun
%if %{mdkversion} < 200900
%clean_desktop_database
%clean_mime_database
%endif
%if %{use_milkjf}
if [ ${1} -eq 0 ] && [ -f %{_datadir}/X11/locale/ja_JP.UTF-8/XLC_LOCALE.rpmsave-sted2 ]; then
%{__mv} %{_datadir}/X11/locale/ja_JP.UTF-8/XLC_LOCALE{.rpmsave-sted2,}
fi
%endif
%clean
%{__rm} %{buildroot} -fr
%files
%defattr(-, root, root)
%{_bindir}/sted2
%{_datadir}/applications/sted2.desktop
%{_datadir}/mime/packages/sted2.xml
%{_datadir}/locale/*/LC_MESSAGES/sted2.mo
%dir %{_sysconfdir}/sted2
%dir %{_sysconfdir}/sted2/deffile
%config %{_sysconfdir}/sted2/*
%config %{_sysconfdir}/sted2/deffile/*
%doc AUTHORS* ChangeLog* README* doc/*.lzma doc/original_docs/*.lzma doc/original_docs/sted207/*.lzma
%changelog
* Fri Nov 27 2009 kakurasan <kakurasan AT gmail DOT com> 20021104-2kkr2010.0
- fix sysconfdir (/etc -> %%{_sysconfdir})
- drop unneeded Requires
- fix patch list
* Fri Dec 26 2008 kakurasan <kakurasan AT gmail DOT com> 20021104-1kkr2009.0
- initial build