|Uf LddlZddlZddlZddlZddlZdZdZdZdZdZ dS)Nctj|}tj|dd}t |dksJ|r|dndS)Nz/**/contrib/*.spec.inT) recursiver)libgit get_repo_pathgloblen)project repo_pathrets /obs/lib/rpm_spec.pyget_spec_in_pathr sZ%%g..I )y7774 H H HC s88a<<<< "3q66d"ctj|}tj|d}t|dksJtj|dS)z Get the name to the .tar.xz file generated by dpkg-buildpackage, that we also use in the rpm spec file. This requires lib.debian.move_files_to_output() to run first.z/*.tar.*r)rget_output_pathr r ospathbasename)r path_outputr s rget_source_namersY%g..K ){,,, - -C s88q==== 7  CF # ##rc t|}d|}|r|d|z }tjdddd|d|gtjdddd|d|gdS) z Add a 'Requires: ...' line below the 'Name:' and '%package' lines of the .spec.in file. :param pkgname: of the meta-package to depend on (e.g. osmocom-nightly) :param version: of the meta-pkgname to depend on or None z Requires: z = sed-ez /^Name:/a\-iz /^%package/a\N)rrrun_cmd)r pkgnameversionrreq_lines r add_dependr!s G $ $D%G%%H$O'OO#KmT8T4HIIIK.hdKLLLLLrc t|dt|}t|}|dd}t jdd|dd|g|r d|}t jdd d d |d|gt jdd |dd|gd }t jdd d d |d|gt jddt j|dd|gdS)zi Update the version and source in the .spec.in file. :param version: from get-version-gen script z: generating rpm spec file-.rzs/^Version:.*/Version: /rzEpoch: rz /^Version:/a\zs/^Source:.*/Source: zSource1: rpmlintrcz /^Source:/a\zs/^%setup/%setup -n N) printrrreplacerrrrr)r repochrsource epoch_line rpmlint_lines rgenerater,.sD W 0 0 0111 G $ $D W % %Fooc3''GK<'<<r8s ###$$$MMM$<FFFFFr